{"record":{"id":"76e12d934ee99814","repo":"GoogleContainerTools/skaffold","slug":"creating-components-w","errorCode":null,"errorMessage":"creating components: %w","messagePattern":"creating components: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/tagger_mux.go","lineNumber":82,"sourceCode":"\n\tcase t.ShaTagger != nil:\n\t\treturn &ChecksumTagger{}, nil\n\n\tcase t.GitTagger != nil:\n\t\treturn NewGitCommit(t.GitTagger.Prefix, t.GitTagger.Variant, t.GitTagger.IgnoreChanges)\n\n\tcase t.DateTimeTagger != nil:\n\t\treturn NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone), nil\n\n\tcase t.InputDigest != nil:\n\t\tgraph := graph.ToArtifactGraph(runCtx.Artifacts())\n\t\treturn NewInputDigestTagger(runCtx, graph)\n\n\tcase t.CustomTemplateTagger != nil:\n\t\tcomponents, err := CreateComponents(runCtx, t.CustomTemplateTagger)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"creating components: %w\", err)\n\t\t}\n\n\t\treturn NewCustomTemplateTagger(runCtx, t.CustomTemplateTagger.Template, components)\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown tagger for strategy %+v\", t)\n\t}\n}\n\n// CreateComponents creates a map of taggers for CustomTemplateTagger\nfunc CreateComponents(runCtx *runcontext.RunContext, t *latest.CustomTemplateTagger) (map[string]Tagger, error) {\n\tcomponents := map[string]Tagger{}\n\n\tfor _, taggerComponent := range t.Components {\n\t\tname, c := taggerComponent.Name, taggerComponent.Component\n\n\t\tif _, ok := components[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"multiple components with name %s\", name)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/tagger_mux.go#L64-L100","documentation":"getTagger handles the customTemplate tag strategy by calling CreateComponents to instantiate each named component tagger. This error wraps any failure from CreateComponents — duplicate names (744), nested customTemplate (745), or unknown component types (746) — so the custom template tagger cannot be built.","triggerScenarios":"A pipeline's tagPolicy.customTemplate block whose components list contains invalid entries: duplicate component names, a component that is itself a customTemplate, or a component with no recognized strategy field.","commonSituations":"Copy-pasted component blocks with the same name; accidentally nesting customTemplate inside customTemplate; typos in component keys so no strategy field is recognized; schema version drift changing component shapes.","solutions":["Read the wrapped inner error to identify the bad component","Deduplicate component names in tagPolicy.customTemplate.components","Replace nested customTemplate components with supported ones (envTemplate, sha256, gitCommit, dateTime, inputDigest)","Set exactly one strategy field per component"],"exampleFix":"// before\ntagPolicy:\n  customTemplate:\n    template: \"{{.A}}-{{.B}}\"\n    components:\n      - name: A\n        sha256: {}\n      - name: A\n        dateTime: {}\n\n// after\ntagPolicy:\n  customTemplate:\n    template: \"{{.A}}-{{.B}}\"\n    components:\n      - name: A\n        sha256: {}\n      - name: B\n        dateTime: {}","handlingStrategy":"validation","validationCode":"for _, c := range tp.CustomTemplateTagger.Components {\n    if c.Name == \"\" || (c.EnvTemplateTagger == nil && c.SHA256 == nil && c.GitCommit == nil && c.DateTime == nil && c.InputDigest == nil) {\n        return fmt.Errorf(\"invalid custom template component %q\", c.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":"t, err := tag.NewTaggerMux(runCtx)\nvar cfgErr error\nif errors.As(err, &cfgErr) && strings.Contains(err.Error(), \"creating components\") {\n    // fix tagPolicy.customTemplate and retry once after config reload\n}","preventionTips":["Use unique names and exactly one strategy per customTemplate component","Never nest customTemplate inside components","Run `skaffold config` / schema lint on skaffold.yaml"],"tags":["skaffold","tagging","custom-template"],"backgroundTag":"custom-template-component-invalid","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"}