{"record":{"id":"e0cf172c95d565ea","repo":"goharbor/harbor","slug":"s-is-less-than-zero-e0cf17","errorCode":null,"errorMessage":"%s is less than zero","messagePattern":"(.+?) is less than zero","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/retention/policy/rule/daysps/evaluator.go","lineNumber":80,"sourceCode":"\t\tif p, ok := params[ParameterN]; ok {\n\t\t\tif v, ok := utils.ParseJSONInt(p); ok && v >= 0 {\n\t\t\t\treturn &evaluator{n: int(v)}\n\t\t\t}\n\t\t}\n\t}\n\n\tlog.Warningf(\"default parameter %d used for rule %s\", DefaultN, TemplateID)\n\n\treturn &evaluator{n: DefaultN}\n}\n\n// Valid ...\nfunc Valid(params rule.Parameters) error {\n\tif params != nil {\n\t\tif p, ok := params[ParameterN]; ok {\n\t\t\tif v, ok := utils.ParseJSONInt(p); ok {\n\t\t\t\tif v < 0 {\n\t\t\t\t\treturn fmt.Errorf(\"%s is less than zero\", ParameterN)\n\t\t\t\t}\n\t\t\t\tif v > 20190904 {\n\t\t\t\t\treturn fmt.Errorf(\"%s is too large\", ParameterN)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"%s type error\", ParameterN)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":62,"sourceCodeEnd":92,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/retention/policy/rule/daysps/evaluator.go#L62-L92","documentation":"Error \"%s is less than zero\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/retention/policy/rule/daysps/evaluator.go:80 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"}