GoogleContainerTools/skaffold · error
internal error when retrieving cache result of type %T
Error message
internal error when retrieving cache result of type %T
What it means
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.
Source
Thrown at pkg/skaffold/docker/dependencies.go:118
func GetDependenciesCached(ctx context.Context, buildCfg BuildConfig, cfg Config) ([]string, error) {
absDockerfilePath, err := NormalizeDockerfilePath(buildCfg.workspace, buildCfg.dockerfilePath)
if err != nil {
return nil, fmt.Errorf("normalizing dockerfilePath path: %w", err)
}
return dependencyCache.Exec(buildCfg.artifact, func() ([]string, error) {
return getDependencies(ctx, buildCfg.workspace, buildCfg.dockerfilePath, absDockerfilePath, buildCfg.args, cfg)
})
}
func resultPairForDockerCopyFromTo(deps interface{}) (map[string][]string, error) {
switch t := deps.(type) {
case error:
return nil, t
case map[string][]string:
return t, nil
default:
return nil, fmt.Errorf("internal error when retrieving cache result of type %T", t)
}
}
func getDependencies(ctx context.Context, workspace string, dockerfilePath string, absDockerfilePath string, buildArgs map[string]*string, cfg Config) ([]string, error) {
// If the Dockerfile doesn't exist, we can't compute the dependency.
// But since we know the Dockerfile is a dependency, let's return a list
// with only that file. It makes errors down the line more actionable
// than returning an error now.
if _, err := os.Stat(absDockerfilePath); os.IsNotExist(err) {
return []string{dockerfilePath}, nil
}
fts, err := ReadCopyCmdsFromDockerfile(ctx, false, absDockerfilePath, workspace, buildArgs, cfg)
if err != nil {
return nil, err
}
excludes, err := readDockerignore(workspace, absDockerfilePath)View on GitHub (pinned to a1189de023)
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
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at pkg/skaffold/docker/dependencies.go:118 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/f829eae000fd00d4.
Report an issue: GitHub.