GoogleContainerTools/skaffold · error
running diagnostic on artifacts: %w
Error message
running diagnostic on artifacts: %w
What it means
Wraps any failure from diagnose.CheckArtifacts, which renders and inspects each artifact's manifests during `skaffold diagnose`. The wrapper adds context that the failure happened in the artifact-diagnostics phase, preserving the underlying cause via %w.
Source
Thrown at cmd/skaffold/app/cmd/diagnose.go:125
runCtx, err := getRunContext(ctx, opts, configs)
if err != nil {
return fmt.Errorf("getting run context: %w", err)
}
tagger, err := tag.NewTaggerMux(runCtx)
if err != nil {
return fmt.Errorf("getting tagger: %w", err)
}
imageTags, err := deployutil.ImageTags(ctx, runCtx, tagger, out, runCtx.Artifacts())
if err != nil {
return fmt.Errorf("getting tags: %w", err)
}
for _, c := range configs {
config := c.(*latest.SkaffoldConfig)
fmt.Fprintln(out, "Skaffold version:", version.Get().GitCommit)
fmt.Fprintln(out, "Configuration version:", config.APIVersion)
fmt.Fprintln(out, "Number of artifacts:", len(config.Build.Artifacts))
if err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {
return fmt.Errorf("running diagnostic on artifacts: %w", err)
}
output.Blue.Fprintln(out, "\nConfiguration")
}
return nil
}
View on GitHub (pinned to a1189de023)
Solutions
- Read the wrapped %w cause to identify which artifact/check failed
- Run `skaffold diagnose -v debug` for verbose detail on the failing artifact
- Fix the underlying artifact definition or manifest the cause points to
- Re-run diagnose to confirm the config renders cleanly
Example fix
// underlying cause example
// before: opaque failure inside diagnose run
// after: inspect cause
if err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {
return fmt.Errorf("running diagnostic on artifacts: %w", err)
}
// then fix the artifact/manifest named in err Defensive patterns
Strategy: try-catch
Try / catch
if err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {
return fmt.Errorf("running diagnostic on artifacts: %w", err)
}
// caller: errors.Is/As on the wrapped cause to branch on the specific artifact failure Prevention
- Run `skaffold diagnose` after config changes to catch artifact issues early
- Keep image tags in sync so imageTags lookups succeed
- Validate skaffold.yaml with `skaffold config` tooling before diagnosing
When it happens
Trigger: `skaffold diagnose` (or doDiagnose) iterates loaded configs and calls diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); any error returned by that check (render failures, missing images, bad manifests) is wrapped at diagnose.go:125.
Common situations: Diagnosing a project where an artifact's image tag is missing from imageTags, a builder/renderer plugin fails, or manifests referenced by the artifact cannot be parsed.
Related errors
- `apply` requires at least one manifest argument
- `exec` requires exactly one action to execute
- `config-dependencies add` requires exactly one file path arg
- `jobManifestPaths modify` requires exactly one manifest file
- `inspect namespaces list` requires exactly one manifest file
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/9bfa3092fdb08d18.
Report an issue: GitHub.