{"record":{"id":"4d7a1e839f3c8ba6","repo":"theonedev/onedev","slug":"project-not-specified-4d7a1e","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/GitLfsFilter.java","lineNumber":158,"sourceCode":"\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tprivate String getObjectUrl(HttpServletRequest request, String projectPath, \n\t\t\tString objectId, boolean clusterAccess) {\n\t\tvar serverUrl = clusterAccess ? clusterService.getServerUrl(clusterService.getLocalServerAddress()) : settingService.getSystemSetting().getServerUrl();\n\t\treturn String.format(\"%s/%s.git/lfs/objects/%s?lfs-objects=true\", \n\t\t\t\tStringUtils.stripEnd(serverUrl, \"/\\\\\"), projectPath, objectId);\n\t}\n\n\tprivate String getProjectPath(String pathInfo) {\n\t\tString projectPath = substringBeforeLast(substringBeforeLast(pathInfo, \".git.git/\"), \".git/\");\n\t\tif (StringUtils.isBlank(projectPath))\n\t\t\tthrow new ExplicitException(\"Project not specified\");\n\t\treturn decodeFullRepoNameAsPath(projectPath);\n\t}\n\n\tprivate void reportProjectNotFoundOrInaccessible(HttpServletResponse response, String projectPath) {\n\t\tif (SecurityUtils.getUser() != null) {\n\t\t\tsendBatchError(response, SC_NOT_FOUND, \"Project not found or inaccessible: \" + projectPath);\n\t\t} else {\n\t\t\tresponse.addHeader(\"LFS-Authenticate\", \"Basic realm=\\\"OneDev\\\"\");\n\t\t\tsendBatchError(response, SC_UNAUTHORIZED, \"Authentication required\");\n\t\t}\n\t}\n\t\n\t@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n\t\t\tthrows IOException, ServletException {\n\t\tHttpServletRequest httpRequest = (HttpServletRequest) request;\n\t\tHttpServletResponse httpResponse = (HttpServletResponse) response;\n\t\tString uri = httpRequest.getRequestURI();","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/git/GitLfsFilter.java#L140-L176","documentation":"GitLfsFilter extracts the project path from an LFS request pathInfo by stripping the trailing '.git/' (and LFS-specific '.git.git/') segments; if the result is blank it throws this ExplicitException. Like GitFilter, this indicates a malformed LFS URL with no project path rather than a missing project.","triggerScenarios":"An LFS batch/upload/download request whose pathInfo yields an empty projectPath after substringBeforeLast stripping — e.g. GET/POST to /git or a URL missing the repository segment entirely; getProjectPath is invoked from projectPath() and project() helpers for every LFS operation.","commonSituations":"Misconfigured git-lfs lfs.url endpoint without project path; broken .lfsconfig pointing at the server root; proxy rewrite removing the repo segment; hand-crafted curl against the LFS API with no repo path.","solutions":["Fix the LFS endpoint so it includes the repository path, e.g. lfs.url = https://server/myproject.git/info/lfs","Remove a stale/incorrect .lfsconfig from the repo or set it correctly","Verify reverse-proxy rules preserve the full path for /info/lfs requests","Run GIT_TRACE=1 git lfs env / git lfs logs to inspect the URL being used"],"exampleFix":"// .lfsconfig before\n[lfs]\n\turl = https://onedev.example.com/info/lfs\n\n// after\n[lfs]\n\turl = https://onedev.example.com/myproject.git/info/lfs","handlingStrategy":"validation","validationCode":"const lfsUrl = new URL(lfsEndpoint);\nif (lfsUrl.pathname.replace(/\\/$/, '').split('/').length < 2) {\n  throw new Error('lfs.url must include the project path, e.g. https://server/myproject.git/info/lfs');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let git-lfs derive lfs.url from the remote instead of hardcoding it","Keep .lfsconfig minimal or absent unless overriding","Verify proxy rewrites preserve repo path segments for LFS endpoints"],"tags":["git-lfs","http","url-validation","onedev"],"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"}