{"record":{"id":"3f42f4076111e48e","repo":"theonedev/onedev","slug":"pull-request-source-project-no-longer-exists","errorCode":null,"errorMessage":"Pull request source project no longer exists","messagePattern":"Pull request source project no longer exists","errorType":"http","errorClass":"NotAcceptableException","httpStatus":406,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/ai/TodResource.java","lineNumber":1014,"sourceCode":"        else \n            throw new NotFoundException(\"Previous successful similar build not found\");\n    }\n\n    @Path(\"/get-pull-request\")\n    @GET\n    public Map<String, Object> getPullRequestDetail(\n                @QueryParam(\"currentProject\") @NotNull String currentProjectPath, \n                @QueryParam(\"reference\") @NotNull String pullRequestReference, \n                @QueryParam(\"forWrite\") Boolean forWrite) {\n        if (SecurityUtils.getUser() == null)\n            throw new UnauthenticatedException();\n\n        var currentProject = getProject(currentProjectPath);\n        var pullRequest = getPullRequest(currentProject, pullRequestReference);\n\n        if (forWrite != null && forWrite) {\n            if (pullRequest.getSourceProject() == null)\n                throw new NotAcceptableException(\"Pull request source project no longer exists\");\n\n            if (!SecurityUtils.canWriteCode(pullRequest.getSourceProject()))            \n                throw new UnauthorizedException(\"No permission to write code in pull request source project\");\n        }\n\n        return PullRequestHelper.getDetail(currentProject, pullRequest);\n    }\n\n    @Path(\"/get-pull-request-comments\")\n    @GET\n    public List<Map<String, Object>> getPullRequestComments(\n                @QueryParam(\"currentProject\") @NotNull String currentProjectPath, \n                @QueryParam(\"reference\") @NotNull String pullRequestReference) {\n        if (SecurityUtils.getUser() == null)\n            throw new UnauthenticatedException();\n\n        var currentProject = getProject(currentProjectPath);\n        var pullRequest = getPullRequest(currentProject, pullRequestReference);","sourceCodeStart":996,"sourceCodeEnd":1032,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/ai/TodResource.java#L996-L1032","documentation":"State guard in getPullRequestDetail: the pull request's source project has been deleted since the PR was opened, so its source branch cannot be resolved and the detail cannot be fully built; NotFoundException is thrown. Fix: the PR is effectively broken — recreate it from an existing project or restore the source project.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:1014 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether the source project was deleted or moved and restore/relocate it.","Close or re-target the pull request if the source project is gone."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}