{"record":{"id":"275ee41a8b57ade7","repo":"theonedev/onedev","slug":"revision-path-not-found-revision","errorCode":null,"errorMessage":"Revision/path not found: ${revision}","messagePattern":"Revision/path not found: (.+?)","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/util/RevisionAndPath.java","lineNumber":49,"sourceCode":"\t\t\tif (i != 0)\n\t\t\t\trevisionBuilder.append(\"/\");\n\t\t\trevisionBuilder.append(segments.get(i));\n\t\t\tif (project.getObjectId(revisionBuilder.toString(), false) != null) {\n\t\t\t\trevision = revisionBuilder.toString();\n\t\t\t\tStringBuilder pathBuilder = new StringBuilder();\n\t\t\t\tfor (int j=i+1; j<segments.size(); j++) {\n\t\t\t\t\tif (j != i+1)\n\t\t\t\t\t\tpathBuilder.append(\"/\");\n\t\t\t\t\tpathBuilder.append(segments.get(j));\n\t\t\t\t}\n\t\t\t\tif (pathBuilder.length() != 0) {\n\t\t\t\t\tpath = pathBuilder.toString();\n\t\t\t\t}\n\t\t\t\treturn new RevisionAndPath(revision, path);\n\t\t\t}\n\t\t}\n\t\tif (revisionBuilder.length() != 0) {\n\t\t\tthrow new NotFoundException(\"Revision/path not found: \" + revisionBuilder.toString());\n\t\t} else {\n\t\t\trevision = project.getDefaultBranch();\n\t\t\tif (revision != null && project.getTagRef(revision) != null)\n\t\t\t\treturn new RevisionAndPath(GitUtils.branch2ref(revision), path);\n\t\t\telse\n\t\t\t\treturn new RevisionAndPath(revision, path);\t\t\t\t\n\t\t}\n\t}\n\n\t@Nullable\n\tpublic String getRevision() {\n\t\treturn revision;\n\t}\n\n\t@Nullable\n\tpublic String getPath() {\n\t\treturn path;\n\t}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/util/RevisionAndPath.java#L31-L67","documentation":"RevisionAndPath.parse splits a combined revision/path string and progressively tests prefixes as revisions; when no prefix resolves to a commit (or the string is empty), the whole input is rejected with this NotFound error carrying the revision.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/util/RevisionAndPath.java:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the revision (commit hash, branch or tag) exists in the project repository.","Separate revision and path explicitly instead of relying on prefix inference."],"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-14T05:17:10.506Z"}