{"record":{"id":"f34f2086dcc6256c","repo":"theonedev/onedev","slug":"project-not-found","errorCode":null,"errorMessage":"Project not found: ","messagePattern":"Project not found: ","errorType":"http","errorClass":"NotAcceptableException","httpStatus":400,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/action/RunProjectJobAction.java","lineNumber":194,"sourceCode":"\tpublic String getAccessTokenSecret() {\n\t\treturn accessTokenSecret;\n\t}\n\n\tpublic void setAccessTokenSecret(String accessTokenSecret) {\n\t\tthis.accessTokenSecret = accessTokenSecret;\n\t}\n\t\n\t@SuppressWarnings(\"unused\")\n\tprivate static List<String> getAccessTokenSecretChoices() {\n\t\treturn Project.get().getHierarchyJobSecrets()\n\t\t\t\t.stream().map(it->it.getName()).collect(Collectors.toList());\n\t}\n\n\t@Override\n\tpublic void execute(Build build) {\n\t\tProject project = getProjectService().findByPath(projectPath);\n\t\tif (project == null)\n\t\t\tthrow new NotAcceptableException(\"Project not found: \" + projectPath);\n\n\t\tString secretValue = build.getJobAuthorizationContext().getSecretValue(accessTokenSecret);\n\t\tvar accessToken = getAccessTokenService().findByValue(secretValue);\n\t\tif (accessToken == null)\n\t\t\tthrow new NotAcceptableException(\"Invalid access token\");\n\t\t\n\t\tvar subject = accessToken.asSubject();\n\t\tif (!SecurityUtils.canRunJob(subject, project, jobName))\t\t\n\t\t\tthrow new UnauthorizedException();\n\n\t\tvar user = SecurityUtils.getUser(subject);\n\t\tThreadContext.bind(subject);\n\t\ttry {\n\t\t\tString refName;\n\t\t\tif (branch != null) {\n\t\t\t\trefName = GitUtils.branch2ref(branch);\n\t\t\t} else if (tag != null) {\n\t\t\t\trefName = GitUtils.tag2ref(tag);","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/action/RunProjectJobAction.java#L176-L212","documentation":"RunProjectJobAction.execute resolves projectPath at runtime via ProjectService.findByPath to run a job in another project. If no project matches, it throws NotAcceptableException('Project not found: ' + projectPath), aborting the step.","triggerScenarios":"Executing a RunProjectJobAction during a build where getProjectService().findByPath(projectPath) returns null — the referenced project path does not exist (or is invisible) when the action runs.","commonSituations":"Typo in projectPath; target project renamed/deleted between spec authoring and run; project moved under a different parent path; running the build spec on a different OneDev instance where the project doesn't exist.","solutions":["Fix projectPath in the RunProjectJobAction to the exact full path of the target project.","Update the action if the target project was renamed or moved.","Verify the build's job authorization can see the target project (visibility/permission settings)."],"exampleFix":"// before\nprojectPath: apps/frontend-web\n// after (project moved)\nprojectPath: apps/web/frontend","handlingStrategy":"try-catch","validationCode":"var target = OneDev.getInstance(ProjectService.class).findByPath(projectPath);\nif (target == null) throw new IllegalArgumentException(\"Project not found: \" + projectPath);","typeGuard":null,"tryCatchPattern":"try { runProjectJobAction.execute(build); } catch (NotAcceptableException e) { log.error(\"RunProjectJob failed: {}\", e.getMessage()); }","preventionTips":["Use the project's exact full path from its URL.","Update specs when projects are renamed or moved; audit for references first.","Ensure job authorization context can resolve the target project."],"tags":["project","not-found","runtime","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"}