{"record":{"id":"c7ef6d1414157ab8","repo":"goharbor/harbor","slug":"bad-request-c7ef6d","errorCode":"BAD_REQUEST","errorMessage":"Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 10.","messagePattern":"Error: Invalid number of workers:(.+?)\\. Workers must be greater than 0 and less than or equal to 10\\.","errorType":"validation","errorClass":"*errors.Error","httpStatus":400,"severity":"error","filePath":"src/server/v2.0/handler/gc.go","lineNumber":112,"sourceCode":"\t\tpolicy := gc.Policy{\n\t\t\tExtraAttrs: parameters,\n\t\t}\n\t\tif dryRun, ok := parameters[\"dry_run\"].(bool); ok {\n\t\t\tpolicy.DryRun = dryRun\n\t\t}\n\t\tif deleteUntagged, ok := parameters[\"delete_untagged\"].(bool); ok {\n\t\t\tpolicy.DeleteUntagged = deleteUntagged\n\t\t}\n\t\tif deleteTag, ok := parameters[\"delete_tag\"].(bool); ok {\n\t\t\tpolicy.DeleteTag = deleteTag\n\t\t}\n\t\tif workers, ok := parameters[\"workers\"].(json.Number); ok {\n\t\t\twInt, err := workers.Int64()\n\t\t\tif err != nil {\n\t\t\t\treturn 0, errors.BadRequestError(fmt.Errorf(\"workers should be integer format\"))\n\t\t\t}\n\t\t\tif !validateWorkers(int(wInt)) {\n\t\t\t\treturn 0, errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef(\"Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 10.\", workers)\n\t\t\t}\n\t\t\tpolicy.Workers = int(wInt)\n\t\t}\n\n\t\tid, err = g.gcCtr.Start(ctx, policy, task.ExecutionTriggerManual)\n\tcase ScheduleNone:\n\t\terr = g.gcCtr.DeleteSchedule(ctx)\n\tcase ScheduleHourly, ScheduleDaily, ScheduleWeekly, ScheduleCustom:\n\t\tpolicy := gc.Policy{\n\t\t\tExtraAttrs: parameters,\n\t\t}\n\t\tif dryRun, ok := parameters[\"dry_run\"].(bool); ok {\n\t\t\tpolicy.DryRun = dryRun\n\t\t}\n\t\tif deleteUntagged, ok := parameters[\"delete_untagged\"].(bool); ok {\n\t\t\tpolicy.DeleteUntagged = deleteUntagged\n\t\t}\n\t\tif deleteTag, ok := parameters[\"delete_tag\"].(bool); ok {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/gc.go#L94-L130","documentation":"Error \"Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 10.\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/gc.go:112 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"}