goharbor/harbor · error · lib/errors.Error

BAD_REQUEST

BAD_REQUEST

Error message

addition %s isn't supported

What it means

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

Source

Thrown at src/controller/artifact/processor/base/index.go:46

	return &IndexProcessor{
		RegCli: registry.Cli,
	}
}

// IndexProcessor is a base processor to process artifact enveloped by OCI index or docker manifest list
// Currently, it is just a null implementation
type IndexProcessor struct {
	RegCli registry.Client
}

// AbstractMetadata abstracts metadata of artifact
func (m *IndexProcessor) AbstractMetadata(_ context.Context, _ *artifact.Artifact, _ []byte) error {
	return nil
}

// AbstractAddition abstracts the addition of artifact
func (m *IndexProcessor) AbstractAddition(_ context.Context, _ *artifact.Artifact, addition string) (*processor.Addition, error) {
	return nil, errors.New(nil).WithCode(errors.BadRequestCode).
		WithMessagef("addition %s isn't supported", addition)
}

// GetArtifactType returns the artifact type
func (m *IndexProcessor) GetArtifactType(_ context.Context, _ *artifact.Artifact) string {
	return ""
}

// ListAdditionTypes returns the supported addition types
func (m *IndexProcessor) ListAdditionTypes(_ context.Context, _ *artifact.Artifact) []string {
	return nil
}

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Do not request additions on index artifacts — their addition type list is empty
  2. For per-manifest data, address a specific child manifest digest instead of the index
  3. Gate the API call on artifact type or media type in your client before requesting additions

Example fix

// before
add, err := artifactCtl.GetAddition(ctx, indexArt.ID, "values") // index artifact -> 400
// after
if indexArt.IsIndex() { // or check manifest media type is image index/manifest list
    return fmt.Errorf("index artifacts have no additions")
}
add, err := artifactCtl.GetAddition(ctx, indexArt.ID, "values")
Defensive patterns

Strategy: type-guard

Type guard

var supportedAdditions = map[string][]string{
    "IMAGE": {"build_history"}, // v2 manifests only
    "CHART": {"values", "readme", "dependencies"},
    "CNAI":  {"readme", "license", "files"},
    "WASM":  {"build_history"},
}

func additionSupported(artifactType, addition string) bool {
    for _, a := range supportedAdditions[artifactType] {
        if a == addition {
            return true
        }
    }
    return false // index/manifest-list/CNAB types: no additions at all
}

Try / catch

add, err := artifactCtl.GetAddition(ctx, art.ID, addition)
if err != nil {
    if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), "isn't supported") {
        // addition not valid for this artifact type: skip, do not retry
    }
}

Prevention

When it happens

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

Common situations: Scripts or UI logic written against single-manifest images being reused on multi-arch indexes; automation probing the additions endpoint uniformly across artifact kinds.

Related errors


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