{"record":{"id":"c86a61daed494e63","repo":"theonedev/onedev","slug":"target-project-not-found","errorCode":null,"errorMessage":"Target project not found: ","messagePattern":"Target project not found: ","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/step/PullRepository.java","lineNumber":148,"sourceCode":"\tprivate static String getLfsDescription() {\n\t\tif (!Bootstrap.isInDocker()) {\n\t\t\treturn _T(\"If this option is enabled, git lfs command needs to be installed on OneDev server \"\n\t\t\t\t\t+ \"(even this step runs on other node)\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@Override\n\tpublic ServerStepResult run(Long buildId, File inputDir, TaskLogger logger) {\n\t\treturn OneDev.getInstance(SessionService.class).call(() -> {\n\t\t\tvar build = OneDev.getInstance(BuildService.class).load(buildId);\n\t\t\tProject project = build.getProject();\n\t\t\tProject targetProject;\n\t\t\tif (getTargetProject() != null) {\n\t\t\t\ttargetProject = getProjectService().findByPath(getTargetProject());\n\t\t\t\tif (targetProject == null)\n\t\t\t\t\tthrow new ExplicitException(\"Target project not found: \" + getTargetProject());\n\t\t\t} else {\n\t\t\t\ttargetProject = project;\n\t\t\t}\n\t\t\tboolean authorized = false;\n\t\t\tif (project.isCommitOnBranch(build.getCommitId(), project.getDefaultBranch()) \n\t\t\t\t\t&& project.isSelfOrAncestorOf(targetProject)) {\n\t\t\t\tauthorized = true;\n\t\t\t} else if (getAccessTokenSecret() != null && \n\t\t\t\t\tSecurityUtils.canManageProject(build.getAccessToken(getAccessTokenSecret()).asSubject(), targetProject)) {\n\t\t\t\tauthorized = true;\n\t\t\t}\n\t\t\tif (!authorized) \n\t\t\t\tthrow new ExplicitException(\"This build is not authorized to sync to project: \" + targetProject.getPath());\n\n\t\t\tLong userId;\n\t\t\tif (getAccessTokenSecret() != null) {\n\t\t\t\tuserId = build.getAccessToken(getAccessTokenSecret()).getOwner().getId();\n\t\t\t} else {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/step/PullRepository.java#L130-L166","documentation":"PullRepository.run resolves the configured targetProject path at build time; a null lookup result means no project with that path exists, so the repository cannot be pulled into it. The message carries the path.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/PullRepository.java:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the target project path in the step configuration.","Create the project or pick an existing one."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}