goharbor/harbor · error · lib/errors.Error
BAD_REQUEST
BAD_REQUEST
Error message
addition %s isn't supported for %s(manifest version 2)
What it means
The WASM processor (wasm-to-OCI artifacts) mirrors the image v2 behavior: only the build_history addition is implemented, and AbstractAddition rejects every other addition string with BadRequest, sharing the '(manifest version 2)' message with images.
Source
Thrown at src/controller/artifact/processor/wasm/wasm.go:105
author := config.Author
if len(author) == 0 && len(config.Config.Labels) > 0 {
author = config.Config.Labels["maintainer"]
}
art.ExtraAttrs["author"] = author
} else {
// for wasm-to-oci way
art.ExtraAttrs["manifest.config.mediaType"] = MediaType
if len(manifest.Layers) > 0 {
art.ExtraAttrs["manifest.layers.mediaType"] = manifest.Layers[0].MediaType
art.ExtraAttrs["org.opencontainers.image.title"] = manifest.Layers[0].Annotations["org.opencontainers.image.title"]
}
}
return nil
}
func (m *Processor) AbstractAddition(ctx context.Context, artifact *artifact.Artifact, addition string) (*processor.Addition, error) {
if addition != AdditionTypeBuildHistory {
return nil, errors.New(nil).WithCode(errors.BadRequestCode).
WithMessagef("addition %s isn't supported for %s(manifest version 2)", addition, ArtifactTypeWASM)
}
mani, _, err := m.RegCli.PullManifest(artifact.RepositoryName, artifact.Digest)
if err != nil {
return nil, err
}
_, content, err := mani.Payload()
if err != nil {
return nil, err
}
config := &v1.Image{}
if err = m.ManifestProcessor.UnmarshalConfig(ctx, artifact.RepositoryName, content, config); err != nil {
return nil, err
}
content, err = json.Marshal(config.History)
if err != nil {
return nil, errView on GitHub (pinned to 7b2fd08cc5)
Solutions
- Request only build_history for WASM artifacts
- Gate addition calls on the artifact type (WASM) reported by the API
- Keep a per-type addition allowlist in the client
Defensive patterns
Strategy: type-guard
Type guard
func wasmAdditionSupported(addition string) bool {
return addition == "build_history" // mirrors image v2 behavior
} Try / catch
if _, err := m.AbstractAddition(ctx, art, addition); err != nil {
if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), "WASM") {
// addition != build_history on a WASM artifact: skip
}
} Prevention
- Request only build_history for WASM artifacts
- Gate addition calls on the artifact type (WASM) from the API response
- Keep per-type addition allowlists in client code
When it happens
Trigger: GET .../artifacts/{ref}/additions/{x} on a WASM artifact where x is not build_history — e.g. values, readme, or license.
Common situations: Clients probing chart-style additions on WAS modules; uniform addition-probing across mixed artifact repositories.
Related errors
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/2cb9a8d11ebeaa1c.
Report an issue: GitHub.