goharbor/harbor · error

unsupported format: %s

Error message

unsupported format: %s

What it means

Error "unsupported format: %s" thrown in goharbor/harbor.

Source

Thrown at src/controller/artifact/processor/cnai/parser/base.go:106

	content, err := decodeContent(layer.MediaType, stream, defaultFileSizeLimit)
	if err != nil {
		return "", nil, fmt.Errorf("failed to decode content: %w", err)
	}

	return contentTypeTextPlain, content, nil
}

// decodeContent decodes the content read from reader according to mediaType,
// enforcing that no more than limit bytes are materialized in memory.
func decodeContent(mediaType string, reader io.Reader, limit int64) ([]byte, error) {
	format := filepath.Ext(mediaType)
	switch format {
	case formatTar:
		return untar(reader, limit)
	case formatRaw:
		return readAllLimited(reader, limit)
	default:
		return nil, fmt.Errorf("unsupported format: %s", format)
	}
}

// readAllLimited reads from reader until EOF, but fails once more than limit
// bytes have been read.
func readAllLimited(reader io.Reader, limit int64) ([]byte, error) {
	if limit < 0 {
		return nil, fmt.Errorf("invalid limit: %d", limit)
	}

	// Read up to limit+1 bytes so we can distinguish "exactly at the limit"
	// from "over the limit".
	content, err := io.ReadAll(io.LimitReader(reader, limit+1))
	if err != nil {
		return nil, err
	}

	if int64(len(content)) > limit {

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/controller/artifact/processor/cnai/parser/base.go:106 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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