goharbor/harbor · error · Exception

invalid quota update provider: {}

Error message

invalid quota update provider: {}

What it means

SBOM manager UpdateReportData mirrors the vulnerability-report manager: both uuid and the report payload must be non-empty before the DAO update runs. This instance is the empty-uuid check — there is no row address to update.

Source

Thrown at make/photon/prepare/models.py:254

    def validate(self):
        if not self.enabled:
            return

        if not self.expire_hours or self.expire_hours <= 0:
            raise Exception('cache expire hours should be positive number')
        return

class Core:
    def __init__(self, config: dict):
        self.quota_update_provider = config.get('quota_update_provider') or 'db'

    def validate(self):
        if not self.quota_update_provider:
            return

        if self.quota_update_provider not in ['db', 'redis']:
            raise Exception('invalid quota update provider: {}'.format(self.quota_update_provider))

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Check the uuid is non-empty where it is obtained, not only inside the manager
  2. Use the uuid returned by Create when later updating the same report
  3. Fail fast with the caller's context instead of relying on the manager's generic message

Example fix

// before
err := mgr.UpdateReportData(ctx, uuid, sbomJSON) // uuid may be ""

// after
if uuid == "" {
    return errors.New("cannot update sbom report: uuid unknown")
}
err := mgr.UpdateReportData(ctx, uuid, sbomJSON)
Defensive patterns

Strategy: validation

Validate before calling

if uuid == "" {
    return errors.New("cannot update sbom report: uuid unknown")
}
return mgr.UpdateReportData(ctx, uuid, report)

Try / catch

if err := mgr.UpdateReportData(ctx, uuid, report); err != nil {
    if strings.Contains(err.Error(), "missing uuid") {
        return errors.New("sbom report uuid lost between create and update")
    }
    return err
}

Prevention

When it happens

Trigger: UpdateReportData(ctx, "", report) — e.g. the uuid came from a map lookup with a missing key or a struct field that was never populated.

Common situations: Report identifiers lost between the create and update phases of a job; map/slice indexing bugs yielding empty strings; payload field renames after upgrades.

Related errors


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/0525077feb79d22b. Report an issue: GitHub.