{"record":{"id":"fdc24ca55a9af4a7","repo":"GoogleContainerTools/skaffold","slug":"generating-tag-w","errorCode":null,"errorMessage":"generating tag: %w","messagePattern":"generating tag: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/tag.go","lineNumber":42,"sourceCode":"\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/schema/latest\"\n)\n\n// ImageTags maps image names to tags\ntype ImageTags map[string]string\n\n// Tagger is an interface for tag strategies to be implemented against\ntype Tagger interface {\n\t// GenerateTag generates a tag for an artifact.\n\tGenerateTag(ctx context.Context, image latest.Artifact) (string, error)\n}\n\n// GenerateFullyQualifiedImageName resolves the fully qualified image name for an artifact.\n// The workingDir is the root directory of the artifact with respect to the Skaffold root,\n// and imageName is the base name of the image.\nfunc GenerateFullyQualifiedImageName(ctx context.Context, t Tagger, image latest.Artifact) (string, error) {\n\ttag, err := t.GenerateTag(ctx, image)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"generating tag: %w\", err)\n\t}\n\n\t// Tag is already set in imageName\n\tif tag == \"\" {\n\t\t_, err := docker.ParseReference(image.ImageName)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"parsing image name: %w\", err)\n\t\t}\n\t\treturn image.ImageName, nil\n\t}\n\n\tfullImageName := fmt.Sprintf(\"%v:%v\", image.ImageName, tag)\n\t_, err = docker.ParseReference(fullImageName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"parsing image name: %w\", err)\n\t}\n\treturn fullImageName, nil\n}","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/tag.go#L24-L60","documentation":"GenerateFullyQualifiedImageName delegates to the configured Tagger's GenerateTag and wraps any tagger failure as 'generating tag:'. This is the generic choke point: every tagger error (bad timezone, git failures, env template problems, hashing errors) surfaces through this wrapper.","triggerScenarios":"Calling GenerateFullyQualifiedImageName(ctx, tagger, image) where tagger.GenerateTag returns any error — e.g. gitCommit in a non-git workspace, envTemplate with unset vars, dateTime with an invalid timeZone.","commonSituations":"Debugging skaffold build failures — this wrapping appears in logs above the root cause; CI misconfiguration where the tagger's prerequisites (git repo, env vars) are absent.","solutions":["Read the wrapped cause after 'generating tag:' to identify the actual failing tagger and fix that root cause","Verify the tagger config in skaffold.yaml matches your environment (git present, env vars set, timezone valid)","Switch to a simpler tagger (e.g. dateTime or sha256) to isolate which tagger prerequisite is failing","Run the build locally with the same workspace/CI env to reproduce the tagger failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"tag, err := tag.GenerateFullyQualifiedImageName(ctx, tagger, image)\nif err != nil {\n    var inner error\n    if errors.Unwrap(err) != nil { inner = errors.Unwrap(err) }\n    return fmt.Errorf(\"tagger %T failed: %w (root cause: %v)\", tagger, err, inner)\n}","preventionTips":["Always log the full wrapped error chain (%w/errors.Unwrap) to find the real cause","Smoke-test the tagger in isolation before a full build","Keep tagger prerequisites (git, env vars) verified in CI setup steps"],"tags":["go","skaffold","tagging","wrapper"],"backgroundTag":"tag-generation-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"}