theonedev/onedev · error · ExplicitException

Non-existent pull request specified in recipient address:

Error message

Non-existent pull request specified in recipient address: 

What it means

Similar to the issue case: for pullrequest~<id> subaddresses, if pullRequestService.get(entityId) returns null (no pull request with that id), an ExplicitException 'Non-existent pull request specified in recipient address: <address>' is thrown.

Source

Thrown at server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java:532

												subject, htmlBody, textBody, null, null, threadingReferences);
									} else {
										if (fromUser != null) {
											if (SecurityUtils.canAccessIssue(fromUser.asSubject(), involvedIssue))	
												addComment(involvedIssue, message, fromInternetAddress, fromUser, receiverInternetAddresses);
											else 
												throw new UnauthorizedException("No permission to comment issue: " + involvedIssue.getReference());
										} else {
											if (involvedIssue.getExternalParticipants().contains(fromInternetAddress)) 											
												addComment(involvedIssue, message, fromInternetAddress, null, receiverInternetAddresses);
											else
												throw new UnauthorizedException("Not eligible to comment issue: " + involvedIssue.getReference());
										}
									}
								} else if (subAddress.contains("pullrequest")) {
									if (fromUser != null) {
										involvedPullRequest = pullRequestService.get(entityId);
										if (involvedPullRequest == null)
											throw new ExplicitException("Non-existent pull request specified in recipient address: " + parsedReceiverAddress);
										if (subAddress.contains("unsubscribe")) {
											PullRequestWatch watch = pullRequestWatchService.find(involvedPullRequest, fromUser);
											if (watch != null) 
												watch.setWatching(false);
											
											String subject = "Unsubscribed successfully from pull request " + involvedPullRequest.getReference().toString(null);

											String template = StringUtils.join(settingService.getEmailTemplates().getPullRequestNotificationUnsubscribed(), "\n");
											Map<String, Object> bindings = new HashMap<>();
											bindings.put("pullRequest", involvedPullRequest);
											String htmlBody = EmailTemplates.evalTemplate(true, template, bindings);
											String textBody = EmailTemplates.evalTemplate(false, template, bindings);
											var threadingReferences = getThreadingReferences(UUID.randomUUID().toString(), getMessageId(message));
											sendMailAsync(newArrayList(fromInternetAddress.getAddress()), newArrayList(), newArrayList(),
													subject, htmlBody, textBody, null, null, threadingReferences);
										} else {
											if (!SecurityUtils.canReadCode(involvedPullRequest.getProject())) {
												addComment(involvedPullRequest, message, fromInternetAddress, fromUser, receiverInternetAddresses);

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the pull request id exists and fix the recipient address.
  2. Copy the PR's email address from the pull request page in OneDev.
  3. If the PR was deleted, operate on a different PR or contact maintainers via the project address.

Example fix

// before
To: pullrequest~7777@company.onedev.io  (no such PR)
// after
To: pullrequest~15@company.onedev.io
Defensive patterns

Strategy: validation

Validate before calling

PullRequest pr = pullRequestService.get(id);
if (pr == null) throw new IllegalArgumentException("No pull request with id " + id);

Try / catch

try { handleMessage(message); } catch (ExplicitException e) { sendFailureNotice(from, e.getMessage()); }

Prevention

When it happens

Trigger: Email sent to pullrequest~<id>@... where the numeric id does not correspond to an existing pull request.

Common situations: Address copied from another OneDev instance; pull request deleted; typo in the id; stale saved mail filter/template.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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