{"record":{"id":"6247462e1fe3c075","repo":"theonedev/onedev","slug":"project-not-found-projectpath-624746","errorCode":null,"errorMessage":"Project not found: ${projectPath}","messagePattern":"Project not found: (.+?)","errorType":"exception","errorClass":"EntityNotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java","lineNumber":65,"sourceCode":"import io.onedev.server.web.util.MimeUtils;\nimport io.onedev.server.web.util.WicketUtils;\n\npublic class RawBlobResource extends AbstractResource {\n\n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate static final String PARAM_DISPOSITION = \"disposition\";\n\t\n\tprivate static final Logger logger = LoggerFactory.getLogger(RawBlobResource.class);\n\n\t@Override\n\tprotected ResourceResponse newResourceResponse(Attributes attributes) {\n\t\tPageParameters params = attributes.getParameters();\n\n\t\tString projectPath = params.get(ProjectMapperUtils.PARAM_PROJECT).toString();\n\t\tProject project = getProjectService().findByPath(projectPath);\n\t\tif (project == null)\n\t\t\tthrow new EntityNotFoundException(\"Project not found: \" + projectPath);\n\t\t\n\t\tList<String> revisionAndPathSegments = new ArrayList<>();\n\t\tfor (int i = 0; i < params.getIndexedCount(); i++) {\n\t\t\tString segment = params.get(i).toString();\n\t\t\tif (segment.contains(\"..\"))\n\t\t\t\tthrow new ExplicitException(\"Invalid request path\");\n\t\t\tif (segment.length() != 0)\n\t\t\t\trevisionAndPathSegments.add(segment);\n\t\t}\n\n\t\tBlobIdent blobIdent = new BlobIdent(project, revisionAndPathSegments);\n\n\t\tString revision = blobIdent.revision;\n\t\tString path = blobIdent.path;\n\t\tif (StringUtils.isBlank(revision) || StringUtils.isBlank(path))\n\t\t\tthrow new NotAcceptableException(\"Revision and path should be specified\");\n\n\t\tif (!SecurityUtils.canReadCode(project))","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/resource/RawBlobResource.java#L47-L83","documentation":"RawBlobResource serves raw blob content over HTTP. Before serving, it resolves the project by the path encoded in the URL; if no project matches that path, it throws EntityNotFoundException. This means the first indexed URL segment does not correspond to any existing project.","triggerScenarios":"GET on the raw blob resource URL whose {projectPath} segment does not match any project path, e.g. typo in project name, project renamed/deleted, or URL crafted with a wrong account/project path.","commonSituations":"Hotlinks to raw files after a project rename or delete; typos in scripts/cURL commands; cross-server URLs pointing at a different OneDev instance whose projects differ.","solutions":["Verify the project path segment in the URL matches an existing project (check Administration > Projects or project URL).","Correct typos in the project path portion of the URL.","If the project was renamed, update stored links/scripts to the new path.","If deleted, restore the project or point the URL at another project."],"exampleFix":"// before\ncurl https://onedev.example.com/~raw/my-proj/refs/heads/main/README.md\n// after\ncurl https://onedev.example.com/~raw/myproject/refs/heads/main/README.md","handlingStrategy":"validation","validationCode":"if (!projects.stream().anyMatch(p -> p.getPath().equals(projectPath))) throw new IllegalArgumentException(\"Unknown project path: \" + projectPath);","typeGuard":null,"tryCatchPattern":"try { /* raw request */ } catch (HttpClientErrorException | WebApplicationException e) { if (e.getResponse().getStatus() == 404) { /* handle missing project */ } }","preventionTips":["Resolve project paths via the API before building raw URLs.","Update stored links when projects are renamed or deleted.","Centralize raw-URL construction in one helper to avoid typos."],"tags":["http","resource-not-found","onedev"],"backgroundTag":"resource-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"}