{"record":{"id":"86cff9cc56527df4","repo":"goharbor/harbor","slug":"bad-request-86cff9","errorCode":"BAD_REQUEST","errorMessage":"bad request error level input","messagePattern":"bad request error level input","errorType":"validation","errorClass":"errors.Error","httpStatus":400,"severity":"error","filePath":"src/server/v2.0/handler/robot.go","lineNumber":170,"sourceCode":"\nfunc (rAPI *robotAPI) ListRobot(ctx context.Context, params operation.ListRobotParams) middleware.Responder {\n\tif err := rAPI.RequireAuthenticated(ctx); err != nil {\n\t\treturn rAPI.SendError(ctx, err)\n\t}\n\n\tquery, err := rAPI.BuildQuery(ctx, params.Q, params.Sort, params.Page, params.PageSize)\n\tif err != nil {\n\t\treturn rAPI.SendError(ctx, err)\n\t}\n\n\tvar projectID int64\n\tvar level string\n\t// GET /api/v2.0/robots or GET /api/v2.0/robots?q=Level=system to get all of system level robots.\n\t// GET /api/v2.0/robots?q=Level=project,ProjectID=1\n\tif lv, ok := query.Keywords[\"Level\"]; ok {\n\t\tlevelStr, ok := lv.(string)\n\t\tif !ok || !isValidLevel(levelStr) {\n\t\t\treturn rAPI.SendError(ctx, errors.New(nil).WithMessage(\"bad request error level input\").WithCode(errors.BadRequestCode))\n\t\t}\n\t\tlevel = levelStr\n\t\tif level == robot.LEVELPROJECT {\n\t\t\tpv, ok := query.Keywords[\"ProjectID\"]\n\t\t\tif !ok {\n\t\t\t\treturn rAPI.SendError(ctx, errors.BadRequestError(nil).WithMessage(\"must with project ID when to query project robots\"))\n\t\t\t}\n\t\t\tpidStr, ok := pv.(string)\n\t\t\tif !ok {\n\t\t\t\treturn rAPI.SendError(ctx, errors.BadRequestError(nil).WithMessage(\"ProjectID must be a positive integer\"))\n\t\t\t}\n\t\t\tpid, err := strconv.ParseInt(pidStr, 10, 64)\n\t\t\tif err != nil || pid <= 0 {\n\t\t\t\treturn rAPI.SendError(ctx, errors.BadRequestError(nil).WithMessage(\"ProjectID must be a positive integer\"))\n\t\t\t}\n\t\t\tprojectID = pid\n\t\t} else if level == robot.LEVELSYSTEM {\n\t\t\tquery.Keywords[\"ProjectID\"] = 0","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/robot.go#L152-L188","documentation":"Error \"bad request error level input\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/v2.0/handler/robot.go:170 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"}