goharbor/harbor · error · lib/errors.Error

BAD_REQUEST

BAD_REQUEST

Error message

addition %s isn't supported for %s

What it means

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'.

Source

Thrown at src/controller/artifact/processor/chart/chart.go:63

func init() {
	pc := &processor{
		chartOperator: chart.Optr,
	}
	pc.ManifestProcessor = base.NewManifestProcessor()
	if err := ps.Register(pc, mediaType); err != nil {
		log.Errorf("failed to register processor for media type %s: %v", mediaType, err)
		return
	}
}

type processor struct {
	*base.ManifestProcessor
	chartOperator chart.Operator
}

func (p *processor) AbstractAddition(_ context.Context, artifact *artifact.Artifact, addition string) (*ps.Addition, error) {
	if addition != AdditionTypeValues && addition != AdditionTypeReadme && addition != AdditionTypeDependencies {
		return nil, errors.New(nil).WithCode(errors.BadRequestCode).
			WithMessagef("addition %s isn't supported for %s", addition, ArtifactTypeChart)
	}

	m, _, err := p.RegCli.PullManifest(artifact.RepositoryName, artifact.Digest)
	if err != nil {
		return nil, err
	}
	_, payload, err := m.Payload()
	if err != nil {
		return nil, err
	}
	manifest := &v1.Manifest{}
	if err := json.Unmarshal(payload, manifest); err != nil {
		return nil, err
	}

	for _, layer := range manifest.Layers {
		// chart do have two layers, one is config, we should resolve the other one.

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Request only values, readme, or dependencies for chart artifacts
  2. Gate calls on the artifact type (CHART) before hitting the additions endpoint
  3. Rely on scanning endpoints for vulnerability data on charts, not additions
Defensive patterns

Strategy: type-guard

Type guard

var chartAdditions = map[string]bool{"values": true, "readme": true, "dependencies": true}

func chartAdditionSupported(addition string) bool {
    return chartAdditions[addition]
}

Try / catch

if _, err := p.AbstractAddition(ctx, art, addition); err != nil {
    if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), "CHART") {
        // addition outside {values, readme, dependencies}: skip silently
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: Generic automation assuming image-style additions (build_history) apply to charts; UI code reusing one addition request path for all artifact types.

Related errors


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/88b159e5349de608. Report an issue: GitHub.