goreleaser/goreleaser · error
dockers_v2.sbom: %w
Error message
dockers_v2.sbom: %w
What it means
In the dockers_v2 Run/SBOM step, each DockersV2 config is processed in parallel; before building, p.extraArgs resolves configured SBOM/extra flag options. This error wraps a failure of extraArgs for the dockers_v2.sbom path, meaning the SBOM-related configuration could not be resolved (e.g. SBOM tool unsupported or bad options) and the image build for that config is skipped/failed with the `dockers_v2.sbom:` prefix.
Source
Thrown at internal/pipe/docker/v2/docker.go:183
return g.Wait()
}
// Publish implements publish.Publisher.
func (p Publish) Publish(ctx *context.Context) error {
enabled, err := anyEnabled(ctx)
if err != nil {
return err
}
if !enabled {
return pipe.Skip("configuration is disabled")
}
checkBuildxDriver(ctx)
g := semerrgroup.NewSkipAware(semerrgroup.New(ctx.Parallelism))
for _, d := range ctx.Config.DockersV2 {
g.Go(func() error {
extraArgs, err := p.extraArgs(ctx, d)
if err != nil {
return fmt.Errorf("dockers_v2.sbom: %w", err)
}
return buildImage(ctx, d, extraArgs...)
})
}
err = g.Wait()
// reports whatever was actually pushed, even if another configuration was
// skipped or failed.
for _, img := range ctx.Artifacts.Filter(artifact.ByType(artifact.DockerImageV2)).List() {
summary.Appendf("Pushed Docker image `%s`", img.Name)
}
return err
}
func (Publish) extraArgs(ctx *context.Context, d config.DockerV2) ([]string, error) {
sbom, err := tmpl.New(ctx).Bool(d.SBOM)
if err != nil {
return nil, fmt.Errorf("dockers_v2.sbom: %w", err)
}View on GitHub (pinned to f5edd73956)
Solutions
- Read the wrapped inner error after the `dockers_v2.sbom:` prefix for the exact cause.
- Fix the dockers_v2 sbom configuration to use options supported by dockers_v2 (not the legacy dockers pipe syntax).
- Validate with `goreleaser check` and test with `goreleaser build --snapshot` before a release.
Example fix
// before
dockers_v2:
- sbom: true
// after
dockers_v2:
- sbom:
artifacts: image Defensive patterns
Strategy: validation
Validate before calling
for _, d := range cfg.DockersV2 {
if err := validateV2SbomConfig(d.Sbom); err != nil {
return fmt.Errorf("dockers_v2.sbom misconfigured: %w", err)
}
} Try / catch
if err := release(); err != nil {
if strings.Contains(err.Error(), "dockers_v2.sbom:") {
// inspect wrapped cause and fix the sbom block
}
} Prevention
- Use dockers_v2's own sbom schema, not the legacy dockers pipe options
- Run `goreleaser check` to validate config schema
- Test snapshot builds with the same sbom settings before releasing
When it happens
Trigger: A DockersV2 entry with sbom configuration whose options extraArgs cannot resolve — invalid sbom setting or arguments rejected by the pipe's validation — inside the parallel semerrgroup during Run.
Common situations: Misconfigured dockers_v2.sbom blocks (unknown tool names/flags), configs copied from the v1 dockers pipe that aren't valid for dockers_v2, or environment lacking the SBOM tooling the option requires.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- invalid use: %s, valid options are %v
- failed to copy dockerfile: %w
- failed to copy extra file '%s': %w
- failed to execute image template '%s': %w
- docker manifest: invalid use: %s, valid options are %v
AI-assisted analysis of goreleaser/goreleaser@f5edd73956 (2026-09-05).
Data as JSON: /api/errors/218f9824f25265fd.
Report an issue: GitHub.