theonedev/onedev · error · ExplicitException
Pull request default assignee not found: ${userName}
Error message
Pull request default assignee not found: ${userName} What it means
When OneDev determines default assignees for a pull request, it walks the project hierarchy and resolves each configured default assignee by name via UserService.findByName(). This ExplicitException is thrown when a name listed in the project's pull request settings does not match any existing user. It is a configuration error, not a runtime failure.
Source
Thrown at server-core/src/main/java/io/onedev/server/model/Project.java:2118
Project current = this;
do {
if (current.getPullRequestSetting().getDeleteSourceBranchAfterMerge() != null)
return current.getPullRequestSetting().getDeleteSourceBranchAfterMerge();
current = current.getParent();
} while (current != null);
return false;
}
public List<User> findDefaultPullRequestAssignees() {
Project current = this;
do {
if (!current.getPullRequestSetting().getDefaultAssignees().isEmpty()) {
var users = new ArrayList<User>();
for (var userName: current.getPullRequestSetting().getDefaultAssignees()) {
var user = getUserService().findByName(userName);
if (user == null)
throw new ExplicitException("Pull request default assignee not found: " + userName);
else if (!SecurityUtils.canWriteCode(user.asSubject(), this))
throw new ExplicitException("Pull request default assignee does not have code write permission over the target project: " + userName);
users.add(user);
}
return users;
}
current = current.getParent();
} while (current != null);
return new ArrayList<>();
}
public String getSiteLockName() {
return getSiteLockName(getId());
}
public static String getSiteLockName(Long projectId) {
return "project-site:" + projectId;View on GitHub (pinned to d44925c47c)
Solutions
- Open project (or parent project) settings → Pull Request settings and remove or correct the stale default assignee name
- Check whether the user was renamed and update the setting to the current name
- Recreate the user account if it was deleted and is still needed
- Audit parent projects in the hierarchy, since the setting is resolved upward through parents
Example fix
// before (project setting) defaultAssignees: ["jdoe"] // jdoe deleted // after defaultAssignees: ["john.doe"] // existing active user with code write permission
Defensive patterns
Strategy: validation
Validate before calling
for (String name : project.getPullRequestSetting().getDefaultAssignees()) {
if (OneDev.getInstance(UserService.class).findByName(name) == null)
throw new ValidationException("Default assignee not found: " + name);
} Try / catch
try {
users = project.getPullRequestSetting().getDefaultAssigneeUsers();
} catch (ExplicitException e) {
logger.warn("Bad default assignee config: {}", e.getMessage());
} Prevention
- Validate default assignees when saving project settings
- Clean up settings when deleting user accounts
- Prefer group-based assignment or review rules over raw usernames
When it happens
Trigger: Project's PullRequestSetting.defaultAssignees contains a username that no longer exists (user deleted or renamed) while opening a pull request into that project (or a child inheriting the setting).
Common situations: User account deleted after being configured as default assignee; username typo in project settings; LDAP/user directory sync renamed accounts; inheriting settings from parent project with stale names.
Understand the failure class
Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.
Related errors
- Pull request default assignee does not have code write permi
- Impossible to provide required number of reviewers (candidat
- Unrecognized command:
- Unable to discover cluster ip from database connection url:
- Time tracking needs to be enabled for the project
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/4135c6c2206294a8.
Report an issue: GitHub.