{"record":{"id":"dfeac20b4ce19c89","repo":"goharbor/harbor","slug":"quota-usage-is-negative-for-resource-s-s","errorCode":null,"errorMessage":"quota usage is negative for resource(s): %s","messagePattern":"quota usage is negative for resource\\(s\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/quota/controller.go","lineNumber":520,"sourceCode":"\t\t// ensure that new used is never negative\n\t\tif negativeUsed := types.IsNegative(newUsed); len(negativeUsed) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"resources is negative for resource(s): %s\", quota.PrettyPrintResourceNames(negativeUsed))\n\t\t}\n\n\t\treturn newUsed, nil\n\t}\n}\n\nfunc refreshResources(calculateUsage func() (types.ResourceList, error), ignoreLimitation bool) func(hardLimits, used types.ResourceList) (types.ResourceList, error) {\n\treturn func(hardLimits, used types.ResourceList) (types.ResourceList, error) {\n\t\tnewUsed, err := calculateUsage()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// ensure that new used is never negative\n\t\tif negativeUsed := types.IsNegative(newUsed); len(negativeUsed) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"quota usage is negative for resource(s): %s\", quota.PrettyPrintResourceNames(negativeUsed))\n\t\t}\n\n\t\tif err := quota.IsSafe(hardLimits, used, newUsed, ignoreLimitation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn newUsed, nil\n\t}\n}\n","sourceCodeStart":502,"sourceCodeEnd":530,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/quota/controller.go#L502-L530","documentation":"Error \"quota usage is negative for resource(s): %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/quota/controller.go:520 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"}