{"record":{"id":"b748174e8f91be1d","repo":"theonedev/onedev","slug":"non-existent-issue-specified-in-recipient-address","errorCode":null,"errorMessage":"Non-existent issue specified in recipient address: ","messagePattern":"Non-existent issue specified in recipient address: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java","lineNumber":494,"sourceCode":"\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Unable to create issue from email as service desk is not enabled\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (parsedReceiverAddress.isSubaddress() && systemAddress.equalsIgnoreCase(parsedReceiverAddress.getOriginalAddress())) {\n\t\t\t\t\t\tif (involvedIssue == null && involvedPullRequest == null) {\n\t\t\t\t\t\t\tString subAddress = StringUtils.substringAfter(parsedReceiverAddress.getName(), \"+\");\n\t\t\t\t\t\t\tif (subAddress.equals(MailService.TEST_SUB_ADDRESS)) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else if (subAddress.contains(\"~\")) {\n\t\t\t\t\t\t\t\tLong entityId;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tentityId = Long.parseLong(StringUtils.substringAfter(subAddress, \"~\"));\n\t\t\t\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Invalid id specified in recipient address: \" + parsedReceiverAddress);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (subAddress.contains(\"issue\")) {\n\t\t\t\t\t\t\t\t\tinvolvedIssue = issueService.get(entityId);\n\t\t\t\t\t\t\t\t\tif (involvedIssue == null)\n\t\t\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Non-existent issue specified in recipient address: \" + parsedReceiverAddress);\n\t\t\t\t\t\t\t\t\tif (subAddress.contains(\"unsubscribe\")) {\n\t\t\t\t\t\t\t\t\t\tif (fromUser != null) {\n\t\t\t\t\t\t\t\t\t\t\tvar watch = issueWatchService.find(involvedIssue, fromUser);\n\t\t\t\t\t\t\t\t\t\t\tif (watch != null) \n\t\t\t\t\t\t\t\t\t\t\t\twatch.setWatching(false);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tinvolvedIssue.getExternalParticipants().remove(fromInternetAddress);\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tString subject = \"Unsubscribed successfully from issue \" + involvedIssue.getReference();\n\t\t\t\t\t\t\t\t\t\tString template = settingService.getEmailTemplates().getIssueNotificationUnsubscribed();\n\n\t\t\t\t\t\t\t\t\t\tMap<String, Object> bindings = new HashMap<>();\n\t\t\t\t\t\t\t\t\t\tbindings.put(\"issue\", involvedIssue);\n\n\t\t\t\t\t\t\t\t\t\tString htmlBody = EmailTemplates.evalTemplate(true, template, bindings);\n\t\t\t\t\t\t\t\t\t\tString textBody = EmailTemplates.evalTemplate(false, template, bindings);\n\n\t\t\t\t\t\t\t\t\t\tvar threadingReferences = getThreadingReferences(UUID.randomUUID().toString(), getMessageId(message));","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java#L476-L512","documentation":"After parsing a numeric entity id from an email subaddress (issue~<id>), handleMessage looks up the issue via issueService.get(entityId). If no issue with that id exists, an ExplicitException 'Non-existent issue specified in recipient address: <address>' is thrown.","triggerScenarios":"Email sent to issue~<id>@... where the id parses as a number but no issue with that id exists in the database.","commonSituations":"Emailing an issue id from a different OneDev instance; issue deleted after the address was saved; id typo (e.g. issue~999 when only 50 issues exist).","solutions":["Verify the issue id exists in the target OneDev instance and correct the address.","Copy the issue's email address from the issue page rather than constructing it.","If the issue was deleted, comment on a different issue or open a new one via the project address (with service desk enabled)."],"exampleFix":"// before\nTo: issue~99999@company.onedev.io  (no such issue)\n// after\nTo: issue~42@company.onedev.io","handlingStrategy":"validation","validationCode":"Issue issue = issueService.get(id);\nif (issue == null) throw new IllegalArgumentException(\"No issue with id \" + id);","typeGuard":null,"tryCatchPattern":"try { handleMessage(message); } catch (ExplicitException e) { sendFailureNotice(from, e.getMessage()); }","preventionTips":["Use addresses copied from the issue page","Confirm the issue exists in the same instance","Avoid hardcoding issue ids in templates"],"tags":["email","subaddress","entity-not-found"],"backgroundTag":"entity-not-found","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"}