{"record":{"id":"025a4f566ab47afb","repo":"theonedev/onedev","slug":"project-not-found-or-inaccessible-path","errorCode":null,"errorMessage":"Project not found or inaccessible: ${path}","messagePattern":"Project not found or inaccessible: (.+?)","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java","lineNumber":120,"sourceCode":"\t\t\n\t@Api(order=100)\n\t@Path(\"/{projectId}\")\n    @GET\n    public ProjectData getProject(@PathParam(\"projectId\") Long projectId) {\n    \tProject project = projectService.load(projectId);\n    \tif (!SecurityUtils.canAccessProject(project))\n\t\t\tthrow new UnauthorizedException();\n     \treturn ProjectData.from(project);\n    }\n\n\t@Api(order=125)\n\t@Path(\"/ids/{path:.*}\")\n\t@GET\n\tpublic Long getProjectId(@PathParam(\"path\") String path) {\n\t\tvar project = projectService.findByPath(path);\n\t\tif (project != null) {\n\t\t\tif (!SecurityUtils.canAccessProject(project))\n\t\t\t\tthrow new NotFoundException(\"Project not found or inaccessible: \" + path);\n\t\t\treturn project.getId();\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"Project not found or inaccessible: \" + path);\n\t\t}\n\t}\n\t\n\t@Api(order=150)\n\t@Path(\"/{projectId}/clone-url\")\n    @GET\n    public CloneUrl getCloneURL(@PathParam(\"projectId\") Long projectId) {\n    \tProject project = projectService.load(projectId);\n    \tif (!SecurityUtils.canAccessProject(project))\n\t\t\tthrow new UnauthorizedException();\n\n    \tCloneUrl cloneUrl = new CloneUrl();\n    \tcloneUrl.setHttp(urlService.cloneUrlFor(project, false));\n    \tcloneUrl.setSsh(urlService.cloneUrlFor(project, true));\n    \t","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java#L102-L138","documentation":"Thrown by GET /projects/ids/{path} when the project at the given path cannot be found (projectService.findByPath returns null). It is a JAX-RS NotFoundException mapped to HTTP 404. OneDev deliberately returns the same message for missing and inaccessible projects so callers cannot probe for existence.","triggerScenarios":"Calling GET /~api/projects/ids/{path} with a path that does not match any project (e.g. typo, project deleted, wrong case, path missing the owner prefix like ~user/project).","commonSituations":"CI scripts referencing a renamed or deleted project; clients omitting the user namespace prefix for personal projects; stale configs after a server migration; case-sensitivity mismatches in the path.","solutions":["Verify the exact project path in the OneDev UI (Projects page URL) and correct the path in the API call.","For personal projects, include the owner prefix, e.g. /~api/projects/ids/~john/project.","Confirm the project still exists and was not renamed/deleted; recreate or update references accordingly.","Check you are authenticating as a user with access — inaccessible projects also return 404 (indistinguishable by design)."],"exampleFix":"// before\nGET /~api/projects/ids/my-project  // 404 if it is a personal project\n// after\nGET /~api/projects/ids/~alice/my-project","handlingStrategy":"try-catch","validationCode":"// resolve with the exact path shown in the UI, including owner prefix\nconst path = '~alice/my-project';\nif (!path || path.trim() === '') throw new Error('project path required');\n// optionally GET /~api/projects?query=\"Name\" is \"my-project\" first to confirm existence","typeGuard":null,"tryCatchPattern":"try {\n  const id = await api.get(`/~api/projects/ids/${encodeURIComponent(path)}`);\n} catch (e) {\n  if (e.status === 404) {\n    // treat as 'missing OR no access': verify path, owner prefix, and credentials\n  } else throw e;\n}","preventionTips":["Copy project paths directly from the OneDev UI URL instead of typing them.","Always include the owner prefix (~user/) for personal projects.","Keep project path references in config under review when projects are renamed or deleted.","Remember 404 also means 'no access'; validate credentials before assuming the project is gone."],"tags":["rest","http-404","project","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-14T00:17:10.932Z"}