{"record":{"id":"1a8b9371034b3377","repo":"goharbor/harbor","slug":"unsupported-format-s","errorCode":null,"errorMessage":"unsupported format: %s","messagePattern":"unsupported format: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/artifact/processor/cnai/parser/base.go","lineNumber":106,"sourceCode":"\tcontent, err := decodeContent(layer.MediaType, stream, defaultFileSizeLimit)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"failed to decode content: %w\", err)\n\t}\n\n\treturn contentTypeTextPlain, content, nil\n}\n\n// decodeContent decodes the content read from reader according to mediaType,\n// enforcing that no more than limit bytes are materialized in memory.\nfunc decodeContent(mediaType string, reader io.Reader, limit int64) ([]byte, error) {\n\tformat := filepath.Ext(mediaType)\n\tswitch format {\n\tcase formatTar:\n\t\treturn untar(reader, limit)\n\tcase formatRaw:\n\t\treturn readAllLimited(reader, limit)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported format: %s\", format)\n\t}\n}\n\n// readAllLimited reads from reader until EOF, but fails once more than limit\n// bytes have been read.\nfunc readAllLimited(reader io.Reader, limit int64) ([]byte, error) {\n\tif limit < 0 {\n\t\treturn nil, fmt.Errorf(\"invalid limit: %d\", limit)\n\t}\n\n\t// Read up to limit+1 bytes so we can distinguish \"exactly at the limit\"\n\t// from \"over the limit\".\n\tcontent, err := io.ReadAll(io.LimitReader(reader, limit+1))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif int64(len(content)) > limit {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/cnai/parser/base.go#L88-L124","documentation":"Guard error from decodeContent in the CNAI parser util: the media type's file extension does not match a supported format (tar or raw). The input at fault is the layer media type whose filepath.Ext falls through the switch, so the stream is never decoded.","triggerScenarios":"Thrown at src/controller/artifact/processor/cnai/parser/base.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Push the layer with a supported media type (tar or raw).","Add the format to decodeContent's switch if a new media type must be supported.","Check that annotations/mediaType on the manifest are not misspelled."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}