theonedev/onedev · error · ExplicitException

Target project not found:

Error message

Target project not found: 

What it means

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.

Solutions

  1. Correct the target project path in the step configuration.
  2. Create the project or pick an existing one.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/PullRepository.java:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/c86a61daed494e63. Report an issue: GitHub.

Appendix: source

Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/PullRepository.java:148

	private static String getLfsDescription() {
		if (!Bootstrap.isInDocker()) {
			return _T("If this option is enabled, git lfs command needs to be installed on OneDev server "
					+ "(even this step runs on other node)");
		} else {
			return null;
		}
	}

	@Override
	public ServerStepResult run(Long buildId, File inputDir, TaskLogger logger) {
		return OneDev.getInstance(SessionService.class).call(() -> {
			var build = OneDev.getInstance(BuildService.class).load(buildId);
			Project project = build.getProject();
			Project targetProject;
			if (getTargetProject() != null) {
				targetProject = getProjectService().findByPath(getTargetProject());
				if (targetProject == null)
					throw new ExplicitException("Target project not found: " + getTargetProject());
			} else {
				targetProject = project;
			}
			boolean authorized = false;
			if (project.isCommitOnBranch(build.getCommitId(), project.getDefaultBranch()) 
					&& project.isSelfOrAncestorOf(targetProject)) {
				authorized = true;
			} else if (getAccessTokenSecret() != null && 
					SecurityUtils.canManageProject(build.getAccessToken(getAccessTokenSecret()).asSubject(), targetProject)) {
				authorized = true;
			}
			if (!authorized) 
				throw new ExplicitException("This build is not authorized to sync to project: " + targetProject.getPath());

			Long userId;
			if (getAccessTokenSecret() != null) {
				userId = build.getAccessToken(getAccessTokenSecret()).getOwner().getId();
			} else {

View on GitHub (pinned to d44925c47c)