{"record":{"id":"61c6cd3ca41c7050","repo":"goharbor/harbor","slug":"missing-uuid","errorCode":null,"errorMessage":"missing uuid","messagePattern":"missing uuid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/report/manager.go","lineNumber":190,"sourceCode":"\tif len(registrationUUID) > 0 {\n\t\tkws[\"registration_uuid\"] = registrationUUID\n\t}\n\tif len(mimeTypes) > 0 {\n\t\tkws[\"mime_type__in\"] = mimeTypes\n\t}\n\t// Query all\n\tquery := &q.Query{\n\t\tPageNumber: 0,\n\t\tKeywords:   kws,\n\t}\n\n\treturn bm.dao.List(ctx, query)\n}\n\n// UpdateReportData ...\nfunc (bm *basicManager) UpdateReportData(ctx context.Context, uuid string, report string) error {\n\tif len(uuid) == 0 {\n\t\treturn errors.New(\"missing uuid\")\n\t}\n\n\tif len(report) == 0 {\n\t\treturn errors.New(\"missing report JSON data\")\n\t}\n\n\treturn bm.dao.UpdateReportData(ctx, uuid, report)\n}\n\n// DeleteByDigests ...\nfunc (bm *basicManager) DeleteByDigests(ctx context.Context, digests ...string) error {\n\tif len(digests) == 0 {\n\t\t// Nothing to do\n\t\treturn nil\n\t}\n\n\t// delete the vulnerability records to the report UUID mapping for the digests\n\t// provided","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/report/manager.go#L172-L208","documentation":"Returned by basicManager.UpdateReportData when the uuid argument is empty. Report data updates target an existing report row by UUID; an empty UUID is rejected before delegating to dao.UpdateReportData, since it could never match a row.","triggerScenarios":"Calling UpdateReportData with the UUID returned from a failed/ignored Create; check-in handlers processing a report whose UUID was never persisted; code paths that store the report key in a different variable that stayed empty.","commonSituations":"Ignoring the error from Create and using the zero-value UUID; job retries after partial failures where the first Create never committed; refactors losing the uuid field between create and update stages.","solutions":["Capture and propagate the UUID returned by report.Mgr.Create and use it verbatim for updates","Fail the flow early if Create errored instead of continuing to the update step","Log UUID at both create and update call sites to spot where it goes empty"],"exampleFix":"// before\nuuid, _ := bm.Create(ctx, r) // Create failed, uuid == \"\"\nerr := bm.UpdateReportData(ctx, uuid, rawJSON)\n\n// after\nuuid, err := bm.Create(ctx, r)\nif err != nil {\n    return err\n}\nerr = bm.UpdateReportData(ctx, uuid, rawJSON)","handlingStrategy":"validation","validationCode":"if len(uuid) == 0 {\n    return errors.New(\"report uuid is required to update report data\")\n}\nerr := bm.UpdateReportData(ctx, uuid, reportJSON)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Propagate the UUID returned by Create through the whole flow","Handle Create errors before attempting the update step","Thread the uuid in a struct field rather than loose variables to avoid drops"],"tags":["scan","report","uuid","validation"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}