goharbor/harbor · error
missing uuid
Error message
missing uuid
What it means
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.
Source
Thrown at src/pkg/scan/report/manager.go:190
if len(registrationUUID) > 0 {
kws["registration_uuid"] = registrationUUID
}
if len(mimeTypes) > 0 {
kws["mime_type__in"] = mimeTypes
}
// Query all
query := &q.Query{
PageNumber: 0,
Keywords: kws,
}
return bm.dao.List(ctx, query)
}
// UpdateReportData ...
func (bm *basicManager) UpdateReportData(ctx context.Context, uuid string, report string) error {
if len(uuid) == 0 {
return errors.New("missing uuid")
}
if len(report) == 0 {
return errors.New("missing report JSON data")
}
return bm.dao.UpdateReportData(ctx, uuid, report)
}
// DeleteByDigests ...
func (bm *basicManager) DeleteByDigests(ctx context.Context, digests ...string) error {
if len(digests) == 0 {
// Nothing to do
return nil
}
// delete the vulnerability records to the report UUID mapping for the digests
// providedView on GitHub (pinned to 7b2fd08cc5)
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
Example fix
// before
uuid, _ := bm.Create(ctx, r) // Create failed, uuid == ""
err := bm.UpdateReportData(ctx, uuid, rawJSON)
// after
uuid, err := bm.Create(ctx, r)
if err != nil {
return err
}
err = bm.UpdateReportData(ctx, uuid, rawJSON) Defensive patterns
Strategy: validation
Validate before calling
if len(uuid) == 0 {
return errors.New("report uuid is required to update report data")
}
err := bm.UpdateReportData(ctx, uuid, reportJSON) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- File {} not exist
- Internal dir for tls {} not exist
- nil scan report object
- malformed scan report object
- empty digest to get report data
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/61c6cd3ca41c7050.
Report an issue: GitHub.