RocketChat/Rocket.Chat · error · Meteor.Error

user-not-found

user-not-found

Error message

user-not-found

What it means

Thrown by the CROWD login handler's catch-all: any exception raised while constructing the CROWD client or during crowd.authenticate/updateUserCollection is re-thrown as Meteor.Error('user-not-found', err.message). It is not really 'user not found' — the wrapped err.message (also logged as 'Crowd user not authenticated due to an error') carries the true cause, typically a connection failure to the Atlassian Crowd server, bad CROWD URL/port, TLS problems, or an authentication API error.

Source

Thrown at apps/meteor/server/lib/auth-providers/crowd/crowd.ts:397

		const user = await crowd.authenticate(loginRequest.username, loginRequest.crowdPassword);

		if (user?.crowd === false) {
			logger.debug({ msg: 'User is not a valid crowd user, falling back', username: loginRequest.username });
			return fallbackDefaultAccountSystem(this, loginRequest.username, loginRequest.crowdPassword);
		}

		if (!user) {
			logger.debug({ msg: 'User is not allowed to access Rocket.Chat', username: loginRequest.username });
			return new Meteor.Error('not-authorized', 'User is not authorized by crowd');
		}

		const result = await crowd.updateUserCollection(user);

		return result;
	} catch (err: any) {
		logger.error({ msg: 'Crowd user not authenticated due to an error', err });

		throw new Meteor.Error('user-not-found', err.message);
	}
});

const jobName = 'CROWD_Sync';

Meteor.startup(() => {
	settings.watchMultiple(['CROWD_Sync_User_Data', 'CROWD_Sync_Interval'], async function addCronJobDebounced([data, interval]) {
		if (data !== true) {
			logger.info('Disabling CROWD Background Sync');
			if (await cronJobs.has(jobName)) {
				await cronJobs.remove(jobName);
			}
			return;
		}
		const crowd = new CROWD();
		if (interval) {
			if (await cronJobs.has(jobName)) {
				await cronJobs.remove(jobName);

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Read the wrapped message and the server log line 'Crowd user not authenticated due to an error' to get the underlying cause
  2. Verify CROWD settings (URL, port, application name/password) and Crowd server reachability with curl from the Rocket.Chat host
  3. Confirm the Rocket.Chat application is registered and allowed in Crowd and its credentials are current
  4. Once fixed, retry the login; meanwhile users fall back to local accounts only if the code path allows (CROWD_Enable off or non-crowd user)
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight Crowd connectivity before enabling the handler
const url = settings.get('CROWD_URL');
try {
	const res = await fetch(`${url}/crowd/rest/usermanagement/1/session`);
	if (res.status === 401 || res.status === 404) {
		logger.error('Crowd endpoint reachable but path/credentials look wrong');
	}
} catch (e) {
	logger.error('Crowd server unreachable', e);
}

Try / catch

try {
	await loginWithCrowd(username, password);
} catch (e) {
	if (e instanceof Meteor.Error && e.error === 'user-not-found') {
		// e.reason holds the real cause (connection refused, timeout, Crowd API error)
		// surface a generic 'SSO unavailable' message; alert ops with e.reason
	} else throw e;
}

Prevention

When it happens

Trigger: Login with crowd:true while the Crowd server is unreachable (connection refused/timeout), CROWD_URL misconfigured (wrong host, missing /crowd context path), invalid application name/password credentials registered in Crowd, TLS cert failures, or Crowd returning an error status to the SSO authentication request.

Common situations: Crowd server down or restarted during maintenance; firewall blocking the Crowd port after network changes; Crowd application password rotated but not updated in Rocket.Chat settings; base URL entered with a trailing path or wrong scheme.

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 RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/8037f70ce689ed92. Report an issue: GitHub.