{"record":{"id":"6623b3d6fe008b98","repo":"goharbor/harbor","slug":"bad-request-6623b3","errorCode":"BAD_REQUEST","errorMessage":"addition %s isn't supported","messagePattern":"addition (.+?) isn't supported","errorType":"error_code","errorClass":"lib/errors.Error","httpStatus":400,"severity":"error","filePath":"src/controller/artifact/processor/base/index.go","lineNumber":46,"sourceCode":"\treturn &IndexProcessor{\n\t\tRegCli: registry.Cli,\n\t}\n}\n\n// IndexProcessor is a base processor to process artifact enveloped by OCI index or docker manifest list\n// Currently, it is just a null implementation\ntype IndexProcessor struct {\n\tRegCli registry.Client\n}\n\n// AbstractMetadata abstracts metadata of artifact\nfunc (m *IndexProcessor) AbstractMetadata(_ context.Context, _ *artifact.Artifact, _ []byte) error {\n\treturn nil\n}\n\n// AbstractAddition abstracts the addition of artifact\nfunc (m *IndexProcessor) AbstractAddition(_ context.Context, _ *artifact.Artifact, addition string) (*processor.Addition, error) {\n\treturn nil, errors.New(nil).WithCode(errors.BadRequestCode).\n\t\tWithMessagef(\"addition %s isn't supported\", addition)\n}\n\n// GetArtifactType returns the artifact type\nfunc (m *IndexProcessor) GetArtifactType(_ context.Context, _ *artifact.Artifact) string {\n\treturn \"\"\n}\n\n// ListAdditionTypes returns the supported addition types\nfunc (m *IndexProcessor) ListAdditionTypes(_ context.Context, _ *artifact.Artifact) []string {\n\treturn nil\n}\n","sourceCodeStart":28,"sourceCodeEnd":59,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/base/index.go#L28-L59","documentation":"base.IndexProcessor is embedded by processors for index-style media types — OCI image index, Docker manifest list, and the CNAB bundle processor — and none of them override AbstractAddition. Its default implementation rejects every addition request with BadRequest; index-type artifacts expose no additions at all (ListAdditionTypes returns nil).","triggerScenarios":"GET .../artifacts/{ref}/additions/{anything} on an image index, manifest list, or CNAB artifact — e.g. requesting vulnerabilities, values, or build_history on a multi-arch index digest.","commonSituations":"Scripts or UI logic written against single-manifest images being reused on multi-arch indexes; automation probing the additions endpoint uniformly across artifact kinds.","solutions":["Do not request additions on index artifacts — their addition type list is empty","For per-manifest data, address a specific child manifest digest instead of the index","Gate the API call on artifact type or media type in your client before requesting additions"],"exampleFix":"// before\nadd, err := artifactCtl.GetAddition(ctx, indexArt.ID, \"values\") // index artifact -> 400\n// after\nif indexArt.IsIndex() { // or check manifest media type is image index/manifest list\n    return fmt.Errorf(\"index artifacts have no additions\")\n}\nadd, err := artifactCtl.GetAddition(ctx, indexArt.ID, \"values\")","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"var supportedAdditions = map[string][]string{\n    \"IMAGE\": {\"build_history\"}, // v2 manifests only\n    \"CHART\": {\"values\", \"readme\", \"dependencies\"},\n    \"CNAI\":  {\"readme\", \"license\", \"files\"},\n    \"WASM\":  {\"build_history\"},\n}\n\nfunc additionSupported(artifactType, addition string) bool {\n    for _, a := range supportedAdditions[artifactType] {\n        if a == addition {\n            return true\n        }\n    }\n    return false // index/manifest-list/CNAB types: no additions at all\n}","tryCatchPattern":"add, err := artifactCtl.GetAddition(ctx, art.ID, addition)\nif err != nil {\n    if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), \"isn't supported\") {\n        // addition not valid for this artifact type: skip, do not retry\n    }\n}","preventionTips":["Treat an empty ListAdditionTypes result as 'no additions' and skip the call","Address child manifests directly when you need per-manifest data from an index","Keep a per-type addition allowlist in client code"],"tags":["go","harbor","artifact","additions","bad-request","oci-index","cnab"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}