{"record":{"id":"f829eae000fd00d4","repo":"GoogleContainerTools/skaffold","slug":"internal-error-when-retrieving-cache-result-of-typ","errorCode":null,"errorMessage":"internal error when retrieving cache result of type %T","messagePattern":"internal error when retrieving cache result of type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/dependencies.go","lineNumber":118,"sourceCode":"func GetDependenciesCached(ctx context.Context, buildCfg BuildConfig, cfg Config) ([]string, error) {\n\tabsDockerfilePath, err := NormalizeDockerfilePath(buildCfg.workspace, buildCfg.dockerfilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"normalizing dockerfilePath path: %w\", err)\n\t}\n\n\treturn dependencyCache.Exec(buildCfg.artifact, func() ([]string, error) {\n\t\treturn getDependencies(ctx, buildCfg.workspace, buildCfg.dockerfilePath, absDockerfilePath, buildCfg.args, cfg)\n\t})\n}\n\nfunc resultPairForDockerCopyFromTo(deps interface{}) (map[string][]string, error) {\n\tswitch t := deps.(type) {\n\tcase error:\n\t\treturn nil, t\n\tcase map[string][]string:\n\t\treturn t, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"internal error when retrieving cache result of type %T\", t)\n\t}\n}\n\nfunc getDependencies(ctx context.Context, workspace string, dockerfilePath string, absDockerfilePath string, buildArgs map[string]*string, cfg Config) ([]string, error) {\n\t// If the Dockerfile doesn't exist, we can't compute the dependency.\n\t// But since we know the Dockerfile is a dependency, let's return a list\n\t// with only that file. It makes errors down the line more actionable\n\t// than returning an error now.\n\tif _, err := os.Stat(absDockerfilePath); os.IsNotExist(err) {\n\t\treturn []string{dockerfilePath}, nil\n\t}\n\n\tfts, err := ReadCopyCmdsFromDockerfile(ctx, false, absDockerfilePath, workspace, buildArgs, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\texcludes, err := readDockerignore(workspace, absDockerfilePath)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/dependencies.go#L100-L136","documentation":"This error is a defensive default branch in a type switch inside resultPairForDockerCopyFromTo. That helper unpacks a value previously stored in the dependency cache (via dependencyCache.Exec) which is expected to be either an error or a map[string][]string of resolved dependencies. If the cached value is neither of those types, the switch falls through to the default case and reports an internal error, including the concrete Go type it actually found. It never fires because of bad user input; it means the cache or the code path that populated it stored an unexpected value — an invariant violation in Skaffold's dependency-caching layer, not a problem with the Dockerfile or workspace.","triggerScenarios":"Thrown at pkg/skaffold/docker/dependencies.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report the issue to the Skaffold maintainers, including the type printed by the error and the steps to reproduce — this indicates a bug in Skaffold's dependency cache handling","Clear Skaffold's cache (remove the cache directory or run with caching disabled) so the unexpected cached value is discarded and dependencies are recomputed","Upgrade to a newer Skaffold version in case the type-handling bug in resultPairForDockerCopyFromTo has already been fixed","As a workaround, use a build mode that bypasses dependency caching (e.g. disable the dependency cache) so the malformed cached value is never consulted"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}