{"record":{"id":"9bfa3092fdb08d18","repo":"GoogleContainerTools/skaffold","slug":"running-diagnostic-on-artifacts-w","errorCode":null,"errorMessage":"running diagnostic on artifacts: %w","messagePattern":"running diagnostic on artifacts: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/diagnose.go","lineNumber":125,"sourceCode":"\trunCtx, err := getRunContext(ctx, opts, configs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting run context: %w\", err)\n\t}\n\ttagger, err := tag.NewTaggerMux(runCtx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting tagger: %w\", err)\n\t}\n\timageTags, err := deployutil.ImageTags(ctx, runCtx, tagger, out, runCtx.Artifacts())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting tags: %w\", err)\n\t}\n\tfor _, c := range configs {\n\t\tconfig := c.(*latest.SkaffoldConfig)\n\t\tfmt.Fprintln(out, \"Skaffold version:\", version.Get().GitCommit)\n\t\tfmt.Fprintln(out, \"Configuration version:\", config.APIVersion)\n\t\tfmt.Fprintln(out, \"Number of artifacts:\", len(config.Build.Artifacts))\n\t\tif err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {\n\t\t\treturn fmt.Errorf(\"running diagnostic on artifacts: %w\", err)\n\t\t}\n\n\t\toutput.Blue.Fprintln(out, \"\\nConfiguration\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":107,"sourceCodeEnd":132,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/diagnose.go#L107-L132","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":"// underlying cause example\n// before: opaque failure inside diagnose run\n// after: inspect cause\nif err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {\n    return fmt.Errorf(\"running diagnostic on artifacts: %w\", err)\n}\n// then fix the artifact/manifest named in err","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := diagnose.CheckArtifacts(ctx, runCtx, imageTags, out); err != nil {\n    return fmt.Errorf(\"running diagnostic on artifacts: %w\", err)\n}\n// caller: errors.Is/As on the wrapped cause to branch on the specific artifact failure","preventionTips":["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"],"tags":["cli","skaffold","diagnostics","error-wrapping"],"backgroundTag":"command-diagnostics-failed","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"}