goharbor/harbor · error · lib/errors.Error
BAD_REQUEST
BAD_REQUEST
Error message
addition %s isn't supported
What it means
base.ManifestProcessor is the shared base for manifest-based processors (chart, CNAI, WASM, SBOM, image v2), all of which override AbstractAddition with their own supported sets. This base implementation is the fallback and rejects any addition with BadRequest when an embedding processor does not override the method — i.e., a manifest-based artifact type with no addition support.
Source
Thrown at src/controller/artifact/processor/base/manifest.go:68
}
// if no properties specified, populate all metadata into the ExtraAttrs
if len(m.properties) == 0 {
artifact.ExtraAttrs = metadata
return nil
}
if artifact.ExtraAttrs == nil {
artifact.ExtraAttrs = map[string]any{}
}
for _, property := range m.properties {
artifact.ExtraAttrs[property] = metadata[property]
}
return nil
}
// AbstractAddition abstracts the addition of artifact
func (m *ManifestProcessor) 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 *ManifestProcessor) GetArtifactType(_ context.Context, _ *artifact.Artifact) string {
return ""
}
// ListAdditionTypes returns the supported addition types
func (m *ManifestProcessor) ListAdditionTypes(_ context.Context, _ *artifact.Artifact) []string {
return nil
}
// UnmarshalConfig unmarshal the config blob of the artifact into the specified object "v"
func (m *ManifestProcessor) UnmarshalConfig(_ context.Context, repository string, manifest []byte, v any) error {
// unmarshal manifest
mani := &v1.Manifest{}
if err := json.Unmarshal(manifest, mani); err != nil {View on GitHub (pinned to 7b2fd08cc5)
Solutions
- Do not call the additions endpoint for artifact types whose addition list is empty (ListAdditionTypes returns nothing)
- If you develop a custom processor, override AbstractAddition and ListAdditionTypes to declare real support
- Check the artifact's reported type/media type in the API response before requesting additions
Defensive patterns
Strategy: type-guard
Type guard
func processorSupportsAdditions(mediaType string) bool {
// types whose processors override AbstractAddition with a non-empty set
switch mediaType {
case "application/vnd.docker.distribution.manifest.v2+json",
"application/vnd.oci.image.manifest.v1+json",
"application/vnd.cncf.helm.config.v1+json",
"application/vnd.wasm.content.layer.v1+wasm":
return true
}
return false
} Try / catch
add, err := proc.AbstractAddition(ctx, art, addition)
if err != nil {
if errors.IsErr(err, errors.BadRequestCode) && strings.Contains(err.Error(), "isn't supported") {
// no addition support for this manifest artifact type
}
} Prevention
- When writing a custom processor, decide explicitly whether to override AbstractAddition
- Surface ListAdditionTypes in client/UI logic and honor empty results
- Probe artifact type before calling the additions endpoint
When it happens
Trigger: Requesting /artifacts/{ref}/additions/{type} on an artifact handled by a processor that embeds base.ManifestProcessor without overriding AbstractAddition — typically a custom or third-party Harbor processor; all in-tree embedders override it.
Common situations: Extending Harbor with a new manifest-based artifact processor and forgetting to implement AbstractAddition; generic addition-probing clients hitting unknown artifact kinds.
Related errors
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/3e37155f80d5a06f.
Report an issue: GitHub.