{"record":{"id":"bc559d9c46d600ce","repo":"goharbor/harbor","slug":"no-mime-types-to-make-report-placeholders","errorCode":null,"errorMessage":"no mime types to make report placeholders","messagePattern":"no mime types to make report placeholders","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/sbom/sbom.go","lineNumber":189,"sourceCode":"// retrieveSBOMContent retrieves the \"sbom\" field from the raw report\nfunc retrieveSBOMContent(rawReport string) ([]byte, *v1.Scanner, error) {\n\trpt := sbom.RawSBOMReport{}\n\terr := json.Unmarshal([]byte(rawReport), &rpt)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tsbomContent, err := json.Marshal(rpt.SBOM)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn sbomContent, rpt.Scanner, nil\n}\n\nfunc (h *scanHandler) MakePlaceHolder(ctx context.Context, art *artifact.Artifact, r *scanner.Registration) (rps []*scanModel.Report, err error) {\n\tmgr := h.SBOMMgrFunc()\n\tmimeTypes := r.GetProducesMimeTypes(art.ManifestMediaType, v1.ScanTypeSbom)\n\tif len(mimeTypes) == 0 {\n\t\treturn nil, errors.New(\"no mime types to make report placeholders\")\n\t}\n\tif err := h.delete(ctx, art, mimeTypes[0], r); err != nil {\n\t\treturn nil, err\n\t}\n\tvar reports []*scanModel.Report\n\tfor _, mt := range mimeTypes {\n\t\treport := &sbom.Report{\n\t\t\tArtifactID:       art.ID,\n\t\t\tRegistrationUUID: r.UUID,\n\t\t\tMimeType:         mt,\n\t\t\tMediaType:        sbomMediaTypeSpdx,\n\t\t}\n\n\t\tcreate := func(ctx context.Context) error {\n\t\t\treportUUID, err := mgr.Create(ctx, report)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/sbom/sbom.go#L171-L207","documentation":"Error \"no mime types to make report placeholders\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/sbom/sbom.go:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}