{"record":{"id":"f3bfb5a70e7463d1","repo":"theonedev/onedev","slug":"unable-to-find-project-projectpath","errorCode":null,"errorMessage":"Unable to find project '${projectPath}'","messagePattern":"Unable to find project '(.+?)'","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/util/QueryUtils.java","lineNumber":105,"sourceCode":"\t\n\tpublic static User getUser(String loginName) {\n\t\tUser user = OneDev.getInstance(UserService.class).findByName(loginName);\n\t\tif (user == null)\n\t\t\tthrow new NotFoundException(\"Unable to find user with login: \" + loginName);\n\t\treturn user;\n\t}\n\n\tpublic static Group getGroup(String groupName) {\n\t\tGroup group = OneDev.getInstance(GroupService.class).find(groupName);\n\t\tif (group == null)\n\t\t\tthrow new NotFoundException(\"Unable to find group: \" + groupName);\n\t\treturn group;\n\t}\n\t\n\tpublic static Project getProject(String projectPath) {\n\t\tProject project = OneDev.getInstance(ProjectService.class).findByPath(projectPath);\n\t\tif (project == null)\n\t\t\tthrow new NotFoundException(\"Unable to find project '\" + projectPath + \"'\");\n\t\treturn project;\n\t}\n\t\n\tpublic static boolean getBooleanValue(String value) {\n\t\tif (value.equals(\"true\"))\n\t\t\treturn true;\n\t\telse if (value.equals(\"false\"))\n\t\t\treturn false;\n\t\telse\n\t\t\tthrow new NotAcceptableException(\"Invalid boolean: \" + value);\n\t}\n\t\n\tpublic static Date getDateValue(String value) {\n\t\tDate dateValue = DateUtils.parseRelaxed(value);\n\t\tif (dateValue == null)\n\t\t\tthrow new NotAcceptableException(\"Unrecognized date: \" + value);\n\t\treturn dateValue;\n\t}","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/util/QueryUtils.java#L87-L123","documentation":"QueryUtils.getProject resolves a project path (like 'my-group/my-project') to a Project entity via ProjectService.findByPath. When no project exists at the given path, OneDev throws a NotFoundException with the offending path embedded in the message. It is a lookup helper used by query/criteria parsing code, so a bad path in a query value surfaces here.","triggerScenarios":"Calling QueryUtils.getProject(String projectPath) with a path that does not exist, is misspelled, or references a project the caller cannot see; also triggered indirectly from query parsers resolving criteria values like 'project:foo'.","commonSituations":"Typos in project paths in saved queries or criteria values; project renamed, moved, or deleted after a query was authored; wrong path separators (using '/' vs group nesting); referencing a project that was archived or the user lacks access to.","solutions":["Verify the project path exactly matches the project's path in OneDev (check the project URL in the web UI)","Check whether the project was renamed, moved under a different group, or deleted and update the query/config accordingly","Confirm the calling user has permission to see the project (findByPath may return null for inaccessible projects depending on caller context)","Catch NotFoundException around the call and present a friendly 'project not found' message instead of a stack trace"],"exampleFix":"// before\nProject project = QueryUtils.getProject(\"old-name/my-app\");\n// after\nProject project = OneDev.getInstance(ProjectService.class).findByPath(\"correct-group/my-app\");\nif (project == null) throw new UserException(\"Project 'correct-group/my-app' does not exist\");","handlingStrategy":"validation","validationCode":"Project p = OneDev.getInstance(ProjectService.class).findByPath(projectPath);\nif (p == null) throw new UserException(\"Project '\" + projectPath + \"' not found\");","typeGuard":"boolean projectExists(String path) {\n    return OneDev.getInstance(ProjectService.class).findByPath(path) != null;\n}","tryCatchPattern":"try {\n    Project p = QueryUtils.getProject(path);\n} catch (NotFoundException e) {\n    logger.warn(\"Unknown project path: {}\", path);\n    // surface a user-friendly message or fall back to a default project\n}","preventionTips":["Copy project paths directly from the project URL instead of typing them","Re-check saved queries after renaming or moving projects","Include the full group-qualified path, not just the project name"],"tags":["lookup","project","not-found","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-14T05:17:10.506Z"}