{"record":{"id":"0525077feb79d22b","repo":"goharbor/harbor","slug":"invalid-quota-update-provider","errorCode":null,"errorMessage":"invalid quota update provider: {}","messagePattern":"invalid quota update provider: (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/models.py","lineNumber":254,"sourceCode":"\n    def validate(self):\n        if not self.enabled:\n            return\n\n        if not self.expire_hours or self.expire_hours <= 0:\n            raise Exception('cache expire hours should be positive number')\n        return\n\nclass Core:\n    def __init__(self, config: dict):\n        self.quota_update_provider = config.get('quota_update_provider') or 'db'\n\n    def validate(self):\n        if not self.quota_update_provider:\n            return\n\n        if self.quota_update_provider not in ['db', 'redis']:\n            raise Exception('invalid quota update provider: {}'.format(self.quota_update_provider))","sourceCodeStart":236,"sourceCodeEnd":254,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/models.py#L236-L254","documentation":"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.","triggerScenarios":"UpdateReportData(ctx, \"\", report) — e.g. the uuid came from a map lookup with a missing key or a struct field that was never populated.","commonSituations":"Report identifiers lost between the create and update phases of a job; map/slice indexing bugs yielding empty strings; payload field renames after upgrades.","solutions":["Check the uuid is non-empty where it is obtained, not only inside the manager","Use the uuid returned by Create when later updating the same report","Fail fast with the caller's context instead of relying on the manager's generic message"],"exampleFix":"// before\nerr := mgr.UpdateReportData(ctx, uuid, sbomJSON) // uuid may be \"\"\n\n// after\nif uuid == \"\" {\n    return errors.New(\"cannot update sbom report: uuid unknown\")\n}\nerr := mgr.UpdateReportData(ctx, uuid, sbomJSON)","handlingStrategy":"validation","validationCode":"if uuid == \"\" {\n    return errors.New(\"cannot update sbom report: uuid unknown\")\n}\nreturn mgr.UpdateReportData(ctx, uuid, report)","typeGuard":null,"tryCatchPattern":"if err := mgr.UpdateReportData(ctx, uuid, report); err != nil {\n    if strings.Contains(err.Error(), \"missing uuid\") {\n        return errors.New(\"sbom report uuid lost between create and update\")\n    }\n    return err\n}","preventionTips":["Carry the uuid returned by Create into any later update","Validate map-key lookups before using their results as ids","Fail fast where the uuid is produced, not deep in the manager"],"tags":["go","harbor","sbom","report","validation"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}