{"record":{"id":"3bdea827a2663191","repo":"goharbor/harbor","slug":"malformed-sbom-report-object","errorCode":null,"errorMessage":"malformed sbom report object","messagePattern":"malformed sbom report object","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/sbom/manager.go","lineNumber":123,"sourceCode":"\tdao dao.DAO\n}\n\n// NewManager news basic manager.\nfunc NewManager() Manager {\n\treturn &basicManager{\n\t\tdao: dao.New(),\n\t}\n}\n\n// Create ...\nfunc (bm *basicManager) Create(ctx context.Context, r *model.Report) (string, error) {\n\t// Validate report object\n\tif r == nil {\n\t\treturn \"\", errors.New(\"nil sbom report object\")\n\t}\n\n\tif r.ArtifactID == 0 || len(r.RegistrationUUID) == 0 || len(r.MimeType) == 0 || len(r.MediaType) == 0 {\n\t\treturn \"\", errors.New(\"malformed sbom report object\")\n\t}\n\n\tr.UUID = uuid.New().String()\n\n\t// Insert\n\tif _, err := bm.dao.Create(ctx, r); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn r.UUID, nil\n}\n\nfunc (bm *basicManager) Delete(ctx context.Context, uuid string) error {\n\tquery := q.Query{Keywords: q.KeyWords{\"uuid\": uuid}}\n\tcount, err := bm.dao.DeleteMany(ctx, query)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/sbom/manager.go#L105-L141","documentation":"Error \"malformed sbom report object\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/sbom/manager.go:123 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"}