{"record":{"id":"ee092250fbe1626d","repo":"theonedev/onedev","slug":"assignee-not-found","errorCode":null,"errorMessage":"Assignee not found: ","messagePattern":"Assignee not found: ","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/ai/TodResource.java","lineNumber":1188,"sourceCode":"                if (reviewer.equals(request.getSubmitter()))\n                    throw new NotAcceptableException(\"Pull request submitter cannot be reviewer\");\n\n                if (request.getReview(reviewer) == null) {\n                    PullRequestReview review = new PullRequestReview();\n                    review.setRequest(request);\n                    review.setUser(reviewer);\n                    request.getReviews().add(review);\n                }\n            }\n        }\n\n        @SuppressWarnings(\"unchecked\")\n        var assigneeNames = (List<String>) data.remove(\"assignees\");\n        if (assigneeNames != null) {\n            for (var assigneeName : assigneeNames) {\n                User assignee = userService.findByName(assigneeName);\n                if (assignee == null)\n                    throw new NotFoundException(\"Assignee not found: \" + assigneeName);\n                PullRequestAssignment assignment = new PullRequestAssignment();\n                assignment.setRequest(request);\n                assignment.setUser(assignee);\n                request.getAssignments().add(assignment);\n            }\n        }\n\n        pullRequestService.open(request);\n\n        return PullRequestHelper.getDetail(currentProject, request);        \n    }\n\n    @Api(description = \"Get pull request title and description requirement\")\n    @Path(\"/get-pull-request-title-and-description-requirement\")\n    @GET\n    @Nullable\n    public String getPullRequestTitleAndDescriptionRequirement(\n                @QueryParam(\"currentProject\") @NotNull String currentProjectPath, ","sourceCodeStart":1170,"sourceCodeEnd":1206,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/ai/TodResource.java#L1170-L1206","documentation":"The TOD endpoint resolves each name in the 'assignees' array via userService.findByName() and throws a JAX-RS NotFoundException (HTTP 404) when a name matches no user. The request aborts before creating PullRequestAssignment records.","triggerScenarios":"POST to the TodResource pull-request edit endpoint with data containing an 'assignees' list where any entry is not an exact existing username.","commonSituations":"Typo in assignee name; using display name or email instead of login name; assignee account deleted or renamed; AI agent inventing names.","solutions":["Check the 'assignees' list against the OneDev user list and correct invalid names.","Remove non-existent assignees and resubmit.","Validate names via user lookup API before calling the endpoint."],"exampleFix":"// before\ndata.put(\"assignees\", List.of(\"john.doe@example.com\"));\n// after\ndata.put(\"assignees\", List.of(\"jdoe\"));","handlingStrategy":"validation","validationCode":"for (var name : (List<String>) data.getOrDefault(\"assignees\", List.of())) {\n    if (userService.findByName(name) == null)\n        throw new IllegalArgumentException(\"Unknown assignee: \" + name);\n}","typeGuard":null,"tryCatchPattern":"try {\n    callEditEndpoint(data);\n} catch (NotFoundException e) {\n    if (e.getMessage().startsWith(\"Assignee not found\")) {\n        // drop the invalid assignee and retry\n    } else throw e;\n}","preventionTips":["Validate assignee names against the user API before submission.","Use exact login names; avoid copy-pasting display names.","Keep assignee lists sourced from live project member data, not stale plans."],"tags":["pull-request","assignee","user-lookup","rest-api","onedev"],"backgroundTag":"user-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}