{"record":{"id":"dd8630fa0424742d","repo":"theonedev/onedev","slug":"project-not-specified-dd8630","errorCode":null,"errorMessage":"Project not specified","messagePattern":"Project not specified","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/git/SshCommand.java","lineNumber":103,"sourceCode":"\t\tboolean upload = commandString.startsWith(RemoteConfig.DEFAULT_UPLOAD_PACK);\n\t\tString protocol = environments.get(\"GIT_PROTOCOL\");\n\t\t\n\t\tSshAuthenticator authenticator = OneDev.getInstance(SshAuthenticator.class);\n\t\tThreadContext.bind(asSubject(asPrincipals(asUserPrincipal(authenticator.getPublicKeyOwnerId(session)))));\n\t\t\n\t\tboolean clusterAccess = SecurityUtils.isSystem();\t\t\n\t\t\n\t\tProjectService projectService = OneDev.getInstance(ProjectService.class);\n\n\t\tvar tempStr = StringUtils.substringAfter(commandString, \"'/\");   \n\t\tvar projectPath = decodeFullRepoNameAsPath(substringBefore(tempStr, \"'\"));\n\t\tvar projectFacade = projectService.findFacadeByPath(projectPath);\n\t\tif (projectFacade == null && projectPath.endsWith(\".git\")) {\n\t\t\tprojectPath = StringUtils.substringBeforeLast(projectPath, \".\");\n\t\t\tprojectFacade = projectService.findFacadeByPath(projectPath);\t\t\t\t\n\t\t}\n\t\tif (StringUtils.isBlank(projectPath))\n\t\t\tthrow new ExplicitException(\"Project not specified\");\n        if (projectFacade == null) {\n\t\t\treportProjectNotFoundOrInaccessible(projectPath);\n\t\t\treturn;\n        } \n\t\t\n\t\tClusterService clusterService = OneDev.getInstance(ClusterService.class);\n\t\t\n\t\tString activeServerAddress = projectService.getActiveServer(projectFacade.getId(), true);\n\t\tif (clusterAccess || activeServerAddress.equals(clusterService.getLocalServerAddress())) {\n\t        File gitDir = OneDev.getInstance(ProjectService.class).getGitDir(projectFacade.getId());\n\t\t\tString principal = (String) SecurityUtils.getSubject().getPrincipal();\n\t        Map<String, String> hookEnvs = HookUtils.getReceiveHookEnvs(projectFacade.getId(), principal);\n\n\t        if (!clusterAccess) {\n\t\t        SessionService sessionService = OneDev.getInstance(SessionService.class);\n\t\t        sessionService.openSession(); \n\t\t        try {\n\t\t        \tProject project = projectService.load(projectFacade.getId());","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/git/SshCommand.java#L85-L121","documentation":"SshCommand.start resolves the project path from the SSH command (stripping a single trailing '.git') via projectService.findFacadeByPath. If after this the project path is blank it throws ExplicitException(\"Project not specified\") — the SSH command did not include a parseable project path, so nothing can be executed.","triggerScenarios":"An SSH command whose target cannot be parsed into a non-blank project path — e.g. 'ssh user@server git-upload-pack' with no repository argument, or an empty path component after stripping '.git'.","commonSituations":"Misconfigured Git remote URL missing the repository path; invoking the ssh git command manually without arguments; a client tool constructing a URL with an empty repo segment.","solutions":["Include the project path in the SSH command: ssh user@server git-upload-pack '<project-path>.git'","Fix the remote URL (git remote set-url) so the repository path is present and correct","Check the path/case and user's access if the facade lookup also fails (project reported not found/inaccessible)"],"exampleFix":"# before\ngit remote add origin ssh://user@server           # no project path\n# after\ngit remote set-url origin ssh://user@server/myproject.git","handlingStrategy":"validation","validationCode":"// check command shape before invoking ssh\nString repoArg = /* parsed from ssh command */;\nif (repoArg == null || repoArg.replace(\".git\", \"\").isBlank())\n  throw new IllegalArgumentException(\"SSH command missing project path\");","typeGuard":null,"tryCatchPattern":"try {\n  sshCommand.start();\n} catch (ExplicitException e) {\n  if (\"Project not specified\".equals(e.getMessage())) {\n    // fix remote URL / re-run with repository argument\n  }\n}","preventionTips":["Always include '<project>.git' in git-over-ssh URLs","git remote set-url when migrating remotes","Verify path parsing strips only one '.git' suffix"],"tags":["ssh","git","missing-argument","project-path"],"backgroundTag":"missing-required-argument","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"}