{"record":{"id":"5a7b7b4999cf276e","repo":"goreleaser/goreleaser","slug":"invalid-tags-w","errorCode":null,"errorMessage":"invalid tags: %w","messagePattern":"invalid tags: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pipe/docker/v2/docker.go","lineNumber":370,"sourceCode":"\t\t\tWithError(err).\n\t\t\tDebug(\"could not resolve base image\")\n\t}\n\n\ttpl = tpl.WithExtraFields(tmpl.Fields{\n\t\tkeyBaseImage:       baseImg.name,\n\t\tkeyBaseImageDigest: baseImg.digest,\n\t})\n\n\timages, err := tpl.Slice(d.Images, tmpl.NonEmpty())\n\tif err != nil {\n\t\treturn dockerArgs{}, fmt.Errorf(\"invalid images: %w\", err)\n\t}\n\tif len(images) == 0 {\n\t\treturn dockerArgs{}, pipe.Skip(\"no images\")\n\t}\n\ttags, err := tpl.Slice(d.Tags, tmpl.NonEmpty())\n\tif err != nil {\n\t\treturn dockerArgs{}, fmt.Errorf(\"invalid tags: %w\", err)\n\t}\n\tif len(tags) == 0 {\n\t\treturn dockerArgs{}, errors.New(\"no tags provided\")\n\t}\n\t// Append the -platform bit to non-empty tags.\n\tif len(d.Platforms) == 1 && ctx.Snapshot {\n\t\tsuffix := tagSuffix(d.Platforms[0])\n\t\tfor j := range tags {\n\t\t\ttags[j] += \"-\" + suffix\n\t\t}\n\t}\n\tallImages := makeImageList(images, tags)\n\n\tlabelFlags, err := tplMapFlags(tpl, \"--label\", d.Labels)\n\tif err != nil {\n\t\treturn dockerArgs{}, fmt.Errorf(\"invalid labels: %w\", err)\n\t}\n","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/goreleaser/goreleaser/blob/f5edd7395693c0c6b501dc722d445d2e86af854d/internal/pipe/docker/v2/docker.go#L352-L388","documentation":"makeArgs renders the `tags` list as Go templates with a non-empty constraint. This error wraps any failure applying the templates in config.DockerV2.Tags. (Note: an empty tag list after rendering produces the separate 'no tags provided' error instead.)","triggerScenarios":"A `dockers_v2.tags` entry contains invalid template syntax or unknown fields, e.g. `tags: [\"{{.Version\"], evaluated while makeArgs prepares buildx arguments.","commonSituations":"Typos like `{{.Ver}}`, using fields that don't exist on the release context, malformed conditionals in tags such as `{{ if .IsNightly }}nightly`, or leftover template remnants after refactoring config.","solutions":["Fix the template expression in the offending `dockers_v2.tags` entry.","Use built-in fields like `{{.Version}}`, `{{.Tag}}`, `{{.Major}}.{{.Minor}}` that are known to exist.","Simplify to literal tags (latest, '{{.Version}}') if conditional templating is not required.","Test rendering with `goreleaser release --snapshot --clean`."],"exampleFix":"// before\ndockers_v2:\n  - tags:\n      - \"{{.Vers}}\"\n// after\ndockers_v2:\n  - tags:\n      - \"{{.Version}}\"\n      - latest","handlingStrategy":"validation","validationCode":"// Go: pre-render tags like makeArgs does\nfor _, d := range cfg.DockersV2 {\n    tags, err := tmpl.New(ctx).Slice(d.Tags, tmpl.NonEmpty())\n    if err != nil {\n        return fmt.Errorf(\"invalid tags template: %w\", err)\n    }\n}","typeGuard":"func tagsValid(ctx *context.Context, d config.DockerV2) bool {\n    _, err := tmpl.New(ctx).Slice(d.Tags, tmpl.NonEmpty())\n    return err == nil\n}","tryCatchPattern":"if err := pipe.Run(ctx); err != nil {\n    if strings.Contains(err.Error(), \"invalid tags:\") {\n        log.Fatalf(\"fix dockers_v2.tags templates: %v\", err)\n    }\n    return err\n}","preventionTips":["Stick to standard tags like '{{.Version}}' and 'latest'","Run `goreleaser check` to validate template syntax in CI","Avoid conditional template logic in tags unless tested","Quote YAML values containing braces"],"tags":["goreleaser","template","docker","config"],"backgroundTag":"template-render-failed","analyzedSha":"f5edd7395693c0c6b501dc722d445d2e86af854d","analyzedAt":"2026-09-05T09:57:18.807Z","contentChangedAt":"2026-09-05T09:57:18.807Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}