{"record":{"id":"bd60526067df80e8","repo":"theonedev/onedev","slug":"project-not-found-bd6052","errorCode":null,"errorMessage":"Project not found: ","messagePattern":"Project not found: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/git/LfsAuthenticateCommand.java","lineNumber":108,"sourceCode":"    public void start(ChannelSession channel, Environment env) throws IOException {\n    \tSshAuthenticator authenticator = OneDev.getInstance(SshAuthenticator.class);\n    \tLong userId = authenticator.getPublicKeyOwnerId(session);\n    \tOneDev.getInstance(ExecutorService.class).submit(() -> {\n\t\t\tSessionService sessionService = OneDev.getInstance(SessionService.class);\n\t\t\tsessionService.openSession(); \n\t\t\ttry {\n\t\t\t\tString accessToken = OneDev.getInstance(AccessTokenService.class).createTemporal(userId, 300);\n\t\t\t\tString projectPath = StringUtils.strip(StringUtils.substringBefore(\n\t\t\t\t\t\tcommandString.substring(COMMAND_PREFIX.length()+1), \" \"), \"/\\\\\");\n\t\t\t\t\n\t\t\t\tvar projectService = OneDev.getInstance(ProjectService.class);\n\t\t\t\tvar project = projectService.findByPath(projectPath);\n\t\t\t\tif (project == null && projectPath.endsWith(\".git\")) {\n\t\t\t\t\tprojectPath = StringUtils.substringBeforeLast(projectPath, \".\");\n\t\t\t\t\tproject = projectService.findByPath(projectPath);\n\t\t\t\t}\n\t\t\t\tif (project == null)\n\t\t\t\t\tthrow new ExplicitException(\"Project not found: \" + projectPath);\n\t\t\t\tString url = OneDev.getInstance(UrlService.class).cloneUrlFor(project, false);\n\t\t\t\tMap<Object, Object> response = CollectionUtils.newHashMap(\n\t\t\t\t\t\t\"href\", url + \"/info/lfs\", \n\t\t\t\t\t\t\"header\", CollectionUtils.newHashMap(\n\t\t\t\t\t\t\t\t\"Authorization\", KubernetesHelper.BEARER + \" \" + accessToken)); \n\t\t\t\tout.write(OneDev.getInstance(ObjectMapper.class).writeValueAsBytes(response));\n\t\t\t\tcallback.onExit(0);\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"Error executing \" + COMMAND_PREFIX, e);\n\t\t\t\tnew PrintStream(err).println(\"Check server log for details\");\n\t\t\t\tcallback.onExit(-1);\n\t\t\t} finally {                \n\t\t\t\tsessionService.closeSession();\n\t\t\t}\n\t\t});\n    }\n\n    @Override","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/git/LfsAuthenticateCommand.java#L90-L126","documentation":"The LFS authentication SSH command (LfsAuthenticateCommand.start) resolves the project by path via projectService.findByPath, stripping a trailing '.git' once if needed. If no project matches, it throws ExplicitException(\"Project not found: <path>\") — the clone/LFS URL cannot be built for a non-existent or inaccessible project path.","triggerScenarios":"Running 'git lfs authenticate' (or the ssh lfs-authenticate command) against a project path that does not exist, is misspelled, has wrong case, or is not visible to the authenticated user; only a single '.git' suffix is stripped, so paths like repo.git.git fail.","commonSituations":"Typo in the remote URL; project renamed or deleted; user lacking read access (findByPath returns null for inaccessible projects); wrong OneDev server URL in the remote.","solutions":["Check the project path exists (path and case) under the OneDev instance","Verify the user's access token/account can read the project (inaccessible projects look like missing ones)","Remove the extra suffix — only one '.git' is stripped, so use the exact project path or path + '.git'","Re-clone or update the remote URL with 'onedev' host alias if the server URL changed"],"exampleFix":"# before\ngit lfs authenticate ssh://user@server/my/repo.gIt  # case mismatch -> Project not found\n# after\ngit lfs authenticate ssh://user@server/my/repo.git  # exact path, readable by user","handlingStrategy":"validation","validationCode":"// client-side sanity before running lfs-authenticate\nvar path = uri.getPath().replaceAll(\"^/\", \"\");\nif (!path.endsWith(\".git\")) path += \".git\";\n// only one '.git' is stripped server-side; ensure the base path is exact and readable","typeGuard":null,"tryCatchPattern":"try {\n  runLfsAuthenticate();\n} catch (ExplicitException e) {\n  if (e.getMessage().startsWith(\"Project not found\")) {\n    // verify project path, case, and user read access\n  }\n}","preventionTips":["Use the exact project path from the OneDev UI (case-sensitive)","Remember only one trailing '.git' is stripped — don't double the suffix","Ensure the access token/user has read permission on the project","Update remotes after project rename or server URL change"],"tags":["git-lfs","ssh","project-not-found","url"],"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"}