{"record":{"id":"0c67016c462a8dcc","repo":"theonedev/onedev","slug":"unable-to-find-issue-0-in-project-1","errorCode":null,"errorMessage":"Unable to find issue #{0} in project {1}","messagePattern":"Unable to find issue #(.+?) in project (.+?)","errorType":"exception","errorClass":"EntityNotFoundException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/project/issues/detail/IssueDetailPage.java","lineNumber":119,"sourceCode":"\t\tif (StringUtils.isBlank(issueNumberString)) {\n\t\t\tthrow new RestartResponseException(ProjectIssueListPage.class, \n\t\t\t\t\tProjectIssueListPage.paramsOf(getProject(), null, 0));\n\t\t}\n\t\t\n\t\tissueModel = new LoadableDetachableModel<Issue>() {\n\n\t\t\t@Override\n\t\t\tprotected Issue load() {\n\t\t\t\tLong issueNumber;\n\t\t\t\ttry {\n\t\t\t\t\tissueNumber = Long.valueOf(issueNumberString);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tthrow new NotAcceptableException(MessageFormat.format(_T(\"Invalid issue number: {0}\"), issueNumberString));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIssue issue = issueService.find(getProject(), issueNumber);\n\t\t\t\tif (issue == null) { \n\t\t\t\t\tthrow new EntityNotFoundException(MessageFormat.format(_T(\"Unable to find issue #{0} in project {1}\"), issueNumber, getProject()));\n\t\t\t\t} else {\n\t\t\t\t\tissue = issue.resolveMovedTo();\n\t\t\t\t\tissueLinkService.loadDeepLinks(issue);\n\t\t\t\t\tif (!issue.getProject().equals(getProject())) \n\t\t\t\t\t\tthrow new RestartResponseException(getPageClass(), paramsOf(issue));\n\t\t\t\t\treturn issue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\t}\n\t\n\tpublic Issue getIssue() {\n\t\treturn issueModel.getObject();\n\t}\n\t\n\t@Override\n\tprotected boolean isPermitted() {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/project/issues/detail/IssueDetailPage.java#L101-L137","documentation":"IssueDetailPage looks up the issue by number in the current project via issueService.find(); when no issue with that number exists it throws EntityNotFoundException with this message. Unlike the 'Invalid issue number' error, the parameter parsed fine — the entity simply does not exist in that project.","triggerScenarios":"Loading an issue detail URL whose number exceeds the project's issue count or was deleted; resolving an issue number against the wrong project.","commonSituations":"Issue deleted (or project history reset) while an old link/bookmark is still used; sharing a URL across projects; automated link generation using stale issue numbers after a DB migration.","solutions":["Verify the issue number exists in this project (check the project's issue list).","Check that the URL targets the correct project; the issue may live in another project.","If the issue was moved, use the original URL and OneDev will redirect via resolveMovedTo — but only if the issue itself is found."],"exampleFix":"// before\nopen(projectUrl + \"/~issues/\" + guessedNumber);\n// after\nIssue issue = issueService.find(project, number);\nif (issue != null) open(IssueDetailPage.paramsOf(issue));","handlingStrategy":"validation","validationCode":"Issue issue = issueService.find(project, number);\nif (issue == null) throw new IllegalArgumentException(\"Issue #\" + number + \" does not exist in \" + project.getPath());","typeGuard":"boolean issueExists(Project p, long number) { return issueService.find(p, number) != null; }","tryCatchPattern":"try { loadIssue(number); } catch (EntityNotFoundException e) { showIssueNotFoundMessage(number); }","preventionTips":["Look up issues through issueService.find before deep-linking.","Keep issue numbers in sync with the target project (mind moved issues).","Use OneDev's issue search/list to build links rather than guessing numbers."],"tags":["wicket","issues","not-found","url"],"backgroundTag":"entity-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}