{"record":{"id":"2cb9a8d11ebeaa1c","repo":"goharbor/harbor","slug":"bad-request-2cb9a8","errorCode":"BAD_REQUEST","errorMessage":"addition %s isn't supported for %s(manifest version 2)","messagePattern":"addition (.+?) isn't supported for (.+?)\\(manifest version 2\\)","errorType":"validation","errorClass":"lib/errors.Error","httpStatus":400,"severity":"error","filePath":"src/controller/artifact/processor/wasm/wasm.go","lineNumber":105,"sourceCode":"\t\tauthor := config.Author\n\t\tif len(author) == 0 && len(config.Config.Labels) > 0 {\n\t\t\tauthor = config.Config.Labels[\"maintainer\"]\n\t\t}\n\t\tart.ExtraAttrs[\"author\"] = author\n\t} else {\n\t\t// for wasm-to-oci way\n\t\tart.ExtraAttrs[\"manifest.config.mediaType\"] = MediaType\n\t\tif len(manifest.Layers) > 0 {\n\t\t\tart.ExtraAttrs[\"manifest.layers.mediaType\"] = manifest.Layers[0].MediaType\n\t\t\tart.ExtraAttrs[\"org.opencontainers.image.title\"] = manifest.Layers[0].Annotations[\"org.opencontainers.image.title\"]\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *Processor) AbstractAddition(ctx context.Context, artifact *artifact.Artifact, addition string) (*processor.Addition, error) {\n\tif addition != AdditionTypeBuildHistory {\n\t\treturn nil, errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\tWithMessagef(\"addition %s isn't supported for %s(manifest version 2)\", addition, ArtifactTypeWASM)\n\t}\n\n\tmani, _, err := m.RegCli.PullManifest(artifact.RepositoryName, artifact.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, content, err := mani.Payload()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig := &v1.Image{}\n\tif err = m.ManifestProcessor.UnmarshalConfig(ctx, artifact.RepositoryName, content, config); err != nil {\n\t\treturn nil, err\n\t}\n\tcontent, err = json.Marshal(config.History)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/wasm/wasm.go#L87-L123","documentation":"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.","triggerScenarios":"GET .../artifacts/{ref}/additions/{x} on a WASM artifact where x is not build_history — e.g. values, readme, or license.","commonSituations":"Clients probing chart-style additions on WAS modules; uniform addition-probing across mixed artifact repositories.","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"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func wasmAdditionSupported(addition string) bool {\n    return addition == \"build_history\" // mirrors image v2 behavior\n}","tryCatchPattern":"if _, err := m.AbstractAddition(ctx, art, addition); err != nil {\n    if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), \"WASM\") {\n        // addition != build_history on a WASM artifact: skip\n    }\n}","preventionTips":["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"],"tags":["go","harbor","wasm","additions","bad-request"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}