{"record":{"id":"ca4bfd448731f62c","repo":"theonedev/onedev","slug":"no-project-found-with-path-projectpath","errorCode":null,"errorMessage":"No project found with path '${projectPath}'","messagePattern":"No project found with path '(.+?)'","errorType":"exception","errorClass":"EntityNotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/pack/PackFilter.java","lineNumber":70,"sourceCode":"    @Override\n\tprotected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) {\n\t\tvar httpRequest = (HttpServletRequest) request;\n\t\tvar httpResponse = (HttpServletResponse) response;\n\t\tvar pathSegments = Splitter.on('/').trimResults().omitEmptyStrings()\n\t\t\t\t.splitToList(httpRequest.getRequestURI());\n\t\tfor (var packHandler: packHandlers) {\n\t\t\tvar handlerMark = \"~\" + packHandler.getHandlerId();\n\t\t\tif (pathSegments.contains(handlerMark)) {\n\t\t\t\tpathSegments = packHandler.normalize(pathSegments);\n\t\t\t\tvar handlerMarkIndex = pathSegments.indexOf(handlerMark);\n\t\t\t\trequest.setAttribute(DefaultSubjectContext.SESSION_CREATION_ENABLED, Boolean.FALSE);\n\t\t\t\tvar projectPath = Joiner.on('/').join(pathSegments.subList(0, handlerMarkIndex));\n\t\t\t\tvar projectId = sessionService.call(() -> {\n\t\t\t\t\tvar project = projectService.findByPath(projectPath);\n\t\t\t\t\tif (project != null)\n\t\t\t\t\t\treturn project.getId();\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new EntityNotFoundException(\"No project found with path '\" + projectPath + \"'\");\n\t\t\t\t});\n\n\t\t\t\tLong buildId = null;\n\t\t\t\tvar apiKey = packHandler.getApiKey(httpRequest);\n\t\t\t\tif (apiKey != null) {\n\t\t\t\t\tvar colonIndex = apiKey.indexOf(':');\n\t\t\t\t\tString jobToken;\n\t\t\t\t\tString accessTokenValue;\n\t\t\t\t\tif (colonIndex != -1) {\n\t\t\t\t\t\tjobToken = apiKey.substring(0, colonIndex);\n\t\t\t\t\t\taccessTokenValue = apiKey.substring(colonIndex +1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjobToken = null;\n\t\t\t\t\t\taccessTokenValue = apiKey;\n\t\t\t\t\t}\n\t\t\t\t\tif (jobToken != null) {\n\t\t\t\t\t\tvar jobContext = jobService.getJobContext(jobToken, false);\n\t\t\t\t\t\tif (jobContext != null)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/pack/PackFilter.java#L52-L88","documentation":"PackFilter routes pack-related HTTP requests (e.g. artifact/package downloads) by parsing the URL path; the leading segments are treated as a project path. If projectService.findByPath finds no project, EntityNotFoundException 'No project found with path <path>' is thrown, resulting in a 404 for the request.","triggerScenarios":"HTTP GET/PUT to a pack URL like /<projectPath>/~pack/... where the path prefix does not match any project path — wrong project name, renamed/moved project, or extra/missing path segments.","commonSituations":"CI scripts publishing/downloading packages with outdated project paths after a project rename; typos in download URLs; accessing packs on a project that was deleted.","solutions":["Fix the URL to use the exact current project path (check project settings)","Verify the project exists and was not renamed or deleted","Use the project id or re-resolve the path via OneDev API before constructing the URL"],"exampleFix":"// before\ncurl https://onedev.example.com/my-proj/~pack/file.zip  // project is 'myproj'\n// after\ncurl https://onedev.example.com/myproj/~pack/file.zip","handlingStrategy":"try-catch","validationCode":"Project p = OneDev.getInstance(ProjectService.class).findByPath(projectPath);\nif (p == null) throw new IllegalArgumentException(\"Unknown project path: \" + projectPath);","typeGuard":null,"tryCatchPattern":"try {\n    downloadPack(url);\n} catch (HttpClientResponseException e) {\n    if (e.getStatusCode() == 404)\n        refreshProjectPathAndRetry();\n}","preventionTips":["Construct pack URLs from the project object's path, never hand-typed strings","Update CI scripts after project renames","Probe project existence via API before generating download links"],"tags":["http","projects","not-found"],"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"}