{"record":{"id":"9070b760f7a44006","repo":"GoogleContainerTools/skaffold","slug":"creating-tagger-w-9070b7","errorCode":null,"errorMessage":"creating tagger: %w","messagePattern":"creating tagger: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/tagger_mux.go","lineNumber":46,"sourceCode":"type TaggerMux struct {\n\tbyImageName map[string]Tagger\n}\n\nfunc (t *TaggerMux) GenerateTag(ctx context.Context, image latest.Artifact) (string, error) {\n\ttagger, found := t.byImageName[image.ImageName]\n\tif !found {\n\t\treturn \"\", fmt.Errorf(\"no valid tagger found for artifact: %q\", image.ImageName)\n\t}\n\treturn tagger.GenerateTag(ctx, image)\n}\n\nfunc NewTaggerMux(runCtx *runcontext.RunContext) (Tagger, error) {\n\tpipelines := runCtx.GetPipelines()\n\tm := make(map[string]Tagger)\n\tfor _, p := range pipelines {\n\t\tt, err := getTagger(runCtx, &p.Build.TagPolicy)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"creating tagger: %w\", err)\n\t\t}\n\t\tfor _, a := range p.Build.Artifacts {\n\t\t\tm[a.ImageName] = t\n\t\t}\n\t}\n\treturn &TaggerMux{byImageName: m}, nil\n}\n\nfunc getTagger(runCtx *runcontext.RunContext, t *latest.TagPolicy) (Tagger, error) {\n\tswitch {\n\tcase runCtx.CustomTag() != \"\":\n\t\treturn &CustomTag{\n\t\t\tTag: runCtx.CustomTag(),\n\t\t}, nil\n\n\tcase t.EnvTemplateTagger != nil:\n\t\treturn NewEnvTemplateTagger(t.EnvTemplateTagger.Template)\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/tagger_mux.go#L28-L64","documentation":"NewTaggerMux builds one Tagger per pipeline by calling getTagger on each pipeline's Build.TagPolicy. This error wraps any failure from getTagger, meaning the tag policy itself could not be instantiated — the mux construction aborts and no tagger is returned.","triggerScenarios":"Calling NewTaggerMux(runCtx) when any pipeline's Build.TagPolicy selects a strategy whose constructor fails: customTemplate with bad components (742), or a tag policy that matches no known strategy (743).","commonSituations":"Invalid customTemplate template/component definitions in skaffold.yaml; empty or malformed tagPolicy blocks; profiles that partially override tagPolicy leaving it invalid.","solutions":["Inspect the wrapped inner error (use %w chain) to find which pipeline's tag policy failed","Fix the offending Build.TagPolicy in skaffold.yaml (e.g. correct the customTemplate components)","Run skaffold config validation/schema check before deploying"],"exampleFix":"// before\ntagPolicy:\n  customTemplate:\n    template: \"{{.UNKNOWN}}\"\n\n// after\ntagPolicy:\n  customTemplate:\n    template: \"{{.SHA}}\"\n    components:\n      - name: SHA\n        sha256: {}","handlingStrategy":"try-catch","validationCode":"for _, p := range runCtx.GetPipelines() {\n    if p.Build.TagPolicy == (latest.TagPolicy{}) {\n        return fmt.Errorf(\"pipeline %s has empty tagPolicy\", p.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":"tagger, err := tag.NewTaggerMux(runCtx)\nif err != nil {\n    return fmt.Errorf(\"skaffold tagger init failed: %w\", err) // inspect wrapped cause\n}","preventionTips":["Validate skaffold.yaml schema before constructing the mux","Ensure profile merges don't leave tagPolicy partially overridden","Log the full wrapped error chain (%w) to find the failing pipeline"],"tags":["skaffold","tagging","config"],"backgroundTag":"tagger-init-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"}