{"record":{"id":"73a7f4f316ddabf1","repo":"theonedev/onedev","slug":"project-not-found-or-inaccessible-projectpath-73a7f4","errorCode":null,"errorMessage":"Project not found or inaccessible: <projectPath>","messagePattern":"Project not found or inaccessible: <projectPath>","errorType":"http","errorClass":"EntityNotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/git/GitFilter.java","lineNumber":109,"sourceCode":"\t\treturn StringUtils.stripStart(pathInfo, \"/\");\n\t}\n\t\n\tprivate Long getProjectId(String projectPath, boolean clusterAccess, boolean upload) {\n\t\tvar facade = projectService.findFacadeByPath(projectPath);\n\t\tif (facade == null && projectPath.endsWith(\".git\")) {\n\t\t\tprojectPath = StringUtils.substringBeforeLast(projectPath, \".\");\n\t\t\tfacade = projectService.findFacadeByPath(projectPath);\n\t\t}\n\t\tif (StringUtils.isBlank(projectPath))\n\t\t\tthrow new ExplicitException(\"Project not specified\");\n\t\tif (facade == null) \n\t\t\treportProjectNotFoundOrInaccessible(projectPath);\n\t\treturn facade.getId();\n\t}\n\n\tprivate void reportProjectNotFoundOrInaccessible(String projectPath) {\n\t\tif (SecurityUtils.getUser() != null)\n\t\t\tthrow new EntityNotFoundException(\"Project not found or inaccessible: \" + projectPath);\n\t\telse\n\t\t\tthrow new UnauthorizedException(\"Authentication required\");\n\t}\n\n\tprivate void doNotCache(HttpServletResponse response) {\n\t\tresponse.setHeader(\"Expires\", \"Fri, 01 Jan 1980 00:00:00 GMT\");\n\t\tresponse.setHeader(\"Pragma\", \"no-cache\");\n\t\tresponse.setHeader(\"Cache-Control\", \"no-cache, max-age=0, must-revalidate\");\n\t}\n\n\tprotected void processPack(final HttpServletRequest request, final HttpServletResponse response) \n\t\t\tthrows IOException, InterruptedException, ExecutionException {\n\t\tboolean upload = GitSmartHttpTools.isUploadPack(request);\n\t\t\n\t\tString pathInfo = getPathInfo(request);\t\n\t\tString service = StringUtils.substringAfterLast(pathInfo, \"/\");\n\t\tString projectInfo = StringUtils.substringBeforeLast(pathInfo, \"/\");\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/git/GitFilter.java#L91-L127","documentation":"reportProjectNotFoundOrInaccessible throws EntityNotFoundException when the project path extracted from a git HTTP request does not resolve to a project facade via projectService.findFacadeByPath, or the current user cannot see it. It deliberately hides whether the project is missing versus inaccessible to avoid information disclosure.","triggerScenarios":"getProjectId, processPack, or processRefs called with a projectPath that returns null from findFacadeByPath (after the .git-suffix retry), while SecurityUtils.getUser() != null (an authenticated or anonymous-but-known session).","commonSituations":"Cloning a project that was renamed, moved, or deleted; typo in project path; user lacks read access to a private project; running under an account whose membership was revoked; case-sensitivity or encoded-path mismatch in the URL.","solutions":["Verify the exact project path in OneDev UI and use it verbatim in the remote URL","Check that the project still exists and was not renamed/deleted","Confirm your user has at least read (code pull) permission on the project","Re-login so your session/token reflects current permissions"],"exampleFix":"// before\ngit clone https://onedev.example.com/myProjct.git\n\n// after\ngit clone https://onedev.example.com/myproject.git","handlingStrategy":"try-catch","validationCode":"// Pre-check project existence/permission via OneDev REST API\nconst res = await fetch(`${server}/api/projects?path=${encodeURIComponent(projectPath)}`);\nif (res.status === 401 || !res.ok) throw new Error('Project ' + projectPath + ' missing or inaccessible');","typeGuard":null,"tryCatchPattern":"try {\n  git.fetch();\n} catch (EntityNotFoundException e) {\n  // message starts with 'Project not found or inaccessible'\n  refreshProjectListAndPermissions();\n}","preventionTips":["Copy project paths from the OneDev UI instead of typing them","Keep project membership and tokens in sync after role changes","Re-login/re-issue tokens after permission changes"],"tags":["git","http","resource-not-found","onedev"],"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"}