{"record":{"id":"88b159e5349de608","repo":"goharbor/harbor","slug":"bad-request-88b159","errorCode":"BAD_REQUEST","errorMessage":"addition %s isn't supported for %s","messagePattern":"addition (.+?) isn't supported for (.+?)","errorType":"error_code","errorClass":"lib/errors.Error","httpStatus":400,"severity":"error","filePath":"src/controller/artifact/processor/chart/chart.go","lineNumber":63,"sourceCode":"func init() {\n\tpc := &processor{\n\t\tchartOperator: chart.Optr,\n\t}\n\tpc.ManifestProcessor = base.NewManifestProcessor()\n\tif err := ps.Register(pc, mediaType); err != nil {\n\t\tlog.Errorf(\"failed to register processor for media type %s: %v\", mediaType, err)\n\t\treturn\n\t}\n}\n\ntype processor struct {\n\t*base.ManifestProcessor\n\tchartOperator chart.Operator\n}\n\nfunc (p *processor) AbstractAddition(_ context.Context, artifact *artifact.Artifact, addition string) (*ps.Addition, error) {\n\tif addition != AdditionTypeValues && addition != AdditionTypeReadme && addition != AdditionTypeDependencies {\n\t\treturn nil, errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\tWithMessagef(\"addition %s isn't supported for %s\", addition, ArtifactTypeChart)\n\t}\n\n\tm, _, err := p.RegCli.PullManifest(artifact.RepositoryName, artifact.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, payload, err := m.Payload()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmanifest := &v1.Manifest{}\n\tif err := json.Unmarshal(payload, manifest); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, layer := range manifest.Layers {\n\t\t// chart do have two layers, one is config, we should resolve the other one.","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/chart/chart.go#L45-L81","documentation":"The Helm chart processor supports exactly three additions — values (values.yaml), readme, and dependencies. AbstractAddition rejects every other addition string with BadRequest 'addition %s isn't supported for CHART'.","triggerScenarios":"GET .../artifacts/{ref}/additions/{x} on a CHART artifact where x is not one of values, readme, dependencies — e.g. build_history, license, or vulnerabilities.","commonSituations":"Generic automation assuming image-style additions (build_history) apply to charts; UI code reusing one addition request path for all artifact types.","solutions":["Request only values, readme, or dependencies for chart artifacts","Gate calls on the artifact type (CHART) before hitting the additions endpoint","Rely on scanning endpoints for vulnerability data on charts, not additions"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"var chartAdditions = map[string]bool{\"values\": true, \"readme\": true, \"dependencies\": true}\n\nfunc chartAdditionSupported(addition string) bool {\n    return chartAdditions[addition]\n}","tryCatchPattern":"if _, err := p.AbstractAddition(ctx, art, addition); err != nil {\n    if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), \"CHART\") {\n        // addition outside {values, readme, dependencies}: skip silently\n    }\n}","preventionTips":["Restrict chart addition calls to values, readme, dependencies","Use the artifact type field from the API response to route addition requests","Get vulnerability data from scanning, not additions"],"tags":["go","harbor","chart","additions","bad-request","helm"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}