theonedev/onedev · error · NotAcceptableException

Pull request source project no longer exists

Error message

Pull request source project no longer exists

What it means

State guard in getPullRequestDetail: the pull request's source project has been deleted since the PR was opened, so its source branch cannot be resolved and the detail cannot be fully built; NotFoundException is thrown. Fix: the PR is effectively broken — recreate it from an existing project or restore the source project.

Source

Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:1014

        else 
            throw new NotFoundException("Previous successful similar build not found");
    }

    @Path("/get-pull-request")
    @GET
    public Map<String, Object> getPullRequestDetail(
                @QueryParam("currentProject") @NotNull String currentProjectPath, 
                @QueryParam("reference") @NotNull String pullRequestReference, 
                @QueryParam("forWrite") Boolean forWrite) {
        if (SecurityUtils.getUser() == null)
            throw new UnauthenticatedException();

        var currentProject = getProject(currentProjectPath);
        var pullRequest = getPullRequest(currentProject, pullRequestReference);

        if (forWrite != null && forWrite) {
            if (pullRequest.getSourceProject() == null)
                throw new NotAcceptableException("Pull request source project no longer exists");

            if (!SecurityUtils.canWriteCode(pullRequest.getSourceProject()))            
                throw new UnauthorizedException("No permission to write code in pull request source project");
        }

        return PullRequestHelper.getDetail(currentProject, pullRequest);
    }

    @Path("/get-pull-request-comments")
    @GET
    public List<Map<String, Object>> getPullRequestComments(
                @QueryParam("currentProject") @NotNull String currentProjectPath, 
                @QueryParam("reference") @NotNull String pullRequestReference) {
        if (SecurityUtils.getUser() == null)
            throw new UnauthenticatedException();

        var currentProject = getProject(currentProjectPath);
        var pullRequest = getPullRequest(currentProject, pullRequestReference);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Check whether the source project was deleted or moved and restore/relocate it.
  2. Close or re-target the pull request if the source project is gone.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:1014 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/3f42f4076111e48e. Report an issue: GitHub.