theonedev/onedev · error · NotFoundException

Unable to find user with login: ${loginName}

Error message

Unable to find user with login: ${loginName}

What it means

QueryUtils.getUser resolves a login name to a User via UserService.findByName. When no user matches, it throws NotFoundException("Unable to find user with login: ...") so query criteria referencing users fail clearly on unknown names.

Source

Thrown at server-core/src/main/java/io/onedev/server/util/QueryUtils.java:91

			var timeTrackingSetting = OneDev.getInstance(SettingService.class).getIssueSetting().getTimeTrackingSetting();
			return timeTrackingSetting.parseWorkingPeriod(value);
		} catch (ValidationException e) {
			throw new NotAcceptableException("Invalid working period: " + value);
		}
	}
	
	public static long getLongValue(String value) {
		try {
			return Long.parseLong(value);
		} catch (NumberFormatException e) {
			throw new NotAcceptableException("Invalid number: " + value);
		}
	}
	
	public static User getUser(String loginName) {
		User user = OneDev.getInstance(UserService.class).findByName(loginName);
		if (user == null)
			throw new NotFoundException("Unable to find user with login: " + loginName);
		return user;
	}

	public static Group getGroup(String groupName) {
		Group group = OneDev.getInstance(GroupService.class).find(groupName);
		if (group == null)
			throw new NotFoundException("Unable to find group: " + groupName);
		return group;
	}
	
	public static Project getProject(String projectPath) {
		Project project = OneDev.getInstance(ProjectService.class).findByPath(projectPath);
		if (project == null)
			throw new NotFoundException("Unable to find project '" + projectPath + "'");
		return project;
	}
	
	public static boolean getBooleanValue(String value) {

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the exact login name in user administration and fix the query operand
  2. Recreate or rename the referenced user account if it was deleted
  3. Update saved queries/automation after user renames or deactivations

Example fix

// before
QueryUtils.getUser("jdoe1"); // throws if login is jdoe
// after
QueryUtils.getUser("jdoe");
Defensive patterns

Strategy: validation

Validate before calling

User user = OneDev.getInstance(UserService.class).findByName(loginName);
boolean userExists = user != null;

Try / catch

try {
    User u = QueryUtils.getUser(loginName);
} catch (NotFoundException e) {
    // suggest closest matching logins to the user
}

Prevention

When it happens

Trigger: Using a user login name in an issue query criterion (e.g. submitter/user fields) where the login does not exist, was renamed, or the user account was deleted/deactivated.

Common situations: Saved queries referencing employees who left (accounts deleted); login case-sensitivity or typo; using display name instead of login name; users renamed after SSO username changes.

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


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