{"record":{"id":"e7fb7a4bc73c39d0","repo":"GoogleContainerTools/skaffold","slug":"custom-tag-not-provided","errorCode":null,"errorMessage":"custom tag not provided","messagePattern":"custom tag not provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/custom.go","lineNumber":34,"sourceCode":"\npackage tag\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/schema/latest\"\n)\n\ntype CustomTag struct {\n\tTag string\n}\n\n// GenerateTag generates a tag using the custom tag.\nfunc (t *CustomTag) GenerateTag(ctx context.Context, _ latest.Artifact) (string, error) {\n\ttag := t.Tag\n\tif tag == \"\" {\n\t\treturn \"\", errors.New(\"custom tag not provided\")\n\t}\n\treturn tag, nil\n}\n","sourceCodeStart":16,"sourceCodeEnd":38,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/custom.go#L16-L38","documentation":"The `custom` tagger uses a fixed, user-supplied tag string for image tagging instead of deriving one from git/env. If CustomTag.Tag is empty — meaning no tag was configured — GenerateTag returns \"custom tag not provided\" because it cannot produce a meaningful tag.","triggerScenarios":"Configuring `tag.custom: {}` with no `tag:` value; constructing latest.CustomTag{Tag: \"\"} programmatically; a templated tag config that evaluates to empty string.","commonSituations":"Copy-pasted tagger config from docs with the tag value omitted; profiles overriding the tagger and dropping the tag field; env-template tags where the env var is unset resulting in empty expansion (though template errors usually surface separately).","solutions":["Set the `tag:` field under `tag.custom` in skaffold.yaml (e.g. tag: v1.0.0).","If the tag is dynamic, use a different tagger (envTemplate, gitCommit, sha256, dateTime).","Verify any config-building code actually assigns CustomTag.Tag before GenerateTag is called.","Check profile merges didn't blank out the custom tag value."],"exampleFix":"# before\ntag:\n  custom: {}\n# after\ntag:\n  custom:\n    tag: v1.2.3","handlingStrategy":"validation","validationCode":"const t = cfg.tag?.custom;\nif (t && (!t.tag || !t.tag.trim())) throw new Error('tag.custom.tag must be a non-empty string');","typeGuard":"function hasCustomTag(t) {\n  return typeof t?.tag === 'string' && t.tag.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Always set tag.custom.tag when choosing the custom tagger","Use envTemplate tagger for dynamic values instead of leaving custom empty","Review profile overrides that may drop the tag field"],"tags":["skaffold","tagging","config-validation"],"backgroundTag":"missing-required-config-field","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"}