{"record":{"id":"3e1ffbbd48b047af","repo":"GoogleContainerTools/skaffold","slug":"unknown-component-for-custom-template-s-v","errorCode":null,"errorMessage":"unknown component for custom template: %s %+v","messagePattern":"unknown component for custom template: (.+?) %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/tagger_mux.go","lineNumber":125,"sourceCode":"\t\tcase c.ShaTagger != nil:\n\t\t\tcomponents[name] = &ChecksumTagger{}\n\n\t\tcase c.GitTagger != nil:\n\t\t\tcomponents[name], _ = NewGitCommit(c.GitTagger.Prefix, c.GitTagger.Variant, c.GitTagger.IgnoreChanges)\n\n\t\tcase c.DateTimeTagger != nil:\n\t\t\tcomponents[name] = NewDateTimeTagger(c.DateTimeTagger.Format, c.DateTimeTagger.TimeZone)\n\n\t\tcase c.InputDigest != nil:\n\t\t\tgraph := graph.ToArtifactGraph(runCtx.Artifacts())\n\t\t\tinputDigest, _ := NewInputDigestTagger(runCtx, graph)\n\t\t\tcomponents[name] = inputDigest\n\n\t\tcase c.CustomTemplateTagger != nil:\n\t\t\treturn nil, fmt.Errorf(\"nested customTemplate components are not supported in skaffold (%s)\", name)\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown component for custom template: %s %+v\", name, c)\n\t\t}\n\t}\n\n\treturn components, nil\n}\n","sourceCodeStart":107,"sourceCodeEnd":131,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/tagger_mux.go#L107-L131","documentation":"CreateComponents' switch matches each component against known strategy fields; a component with none of envTemplate, sha256, gitCommit, dateTime, inputDigest, or customTemplate set falls to the default branch and is rejected. The error echoes the component name and its struct so the misconfiguration is visible.","triggerScenarios":"A customTemplate.components entry that is empty or whose strategy key is misspelled/unknown (e.g. `sha: {}` instead of `sha256: {}`), reached when getTagger builds the tagger.","commonSituations":"YAML typos in strategy keys; empty component blocks left behind after edits; newer/older skaffold schema where a strategy field was renamed; generating config with tooling that emits unknown keys.","solutions":["Give the component exactly one supported strategy field (envTemplate, sha256, gitCommit, dateTime, inputDigest)","Fix the misspelled strategy key shown in the error's %+v dump","Validate skaffold.yaml against the schema for your skaffold version"],"exampleFix":"// before\ncomponents:\n  - name: SHA\n    sha: {}\n\n// after\ncomponents:\n  - name: SHA\n    sha256: {}","handlingStrategy":"validation","validationCode":"supported := []func(*latest.TaggerComponent) bool{\n    func(c *latest.TaggerComponent) bool { return c.EnvTemplateTagger != nil },\n    func(c *latest.TaggerComponent) bool { return c.SHA256 != nil },\n    func(c *latest.TaggerComponent) bool { return c.GitCommit != nil },\n    func(c *latest.TaggerComponent) bool { return c.DateTime != nil },\n    func(c *latest.TaggerComponent) bool { return c.InputDigest != nil },\n}\nfor _, c := range comps {\n    ok := false\n    for _, f := range supported { if f(&c) { ok = true } }\n    if !ok { return fmt.Errorf(\"component %q has no supported strategy\", c.Name) }\n}","typeGuard":null,"tryCatchPattern":"t, err := tag.NewTaggerMux(runCtx)\nif err != nil && strings.Contains(err.Error(), \"unknown component for custom template\") {\n    return fmt.Errorf(\"check component strategy keys in skaffold.yaml: %w\", err)\n}","preventionTips":["Spell strategy keys exactly: envTemplate, sha256, gitCommit, dateTime, inputDigest","Remove empty component blocks from skaffold.yaml","Pin and validate against the JSON schema matching your skaffold version"],"tags":["skaffold","tagging","custom-template","config"],"backgroundTag":"unknown-tag-component","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"}