{"record":{"id":"8037f70ce689ed92","repo":"RocketChat/Rocket.Chat","slug":"user-not-found","errorCode":"user-not-found","errorMessage":"user-not-found","messagePattern":"user-not-found","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/auth-providers/crowd/crowd.ts","lineNumber":397,"sourceCode":"\t\tconst user = await crowd.authenticate(loginRequest.username, loginRequest.crowdPassword);\n\n\t\tif (user?.crowd === false) {\n\t\t\tlogger.debug({ msg: 'User is not a valid crowd user, falling back', username: loginRequest.username });\n\t\t\treturn fallbackDefaultAccountSystem(this, loginRequest.username, loginRequest.crowdPassword);\n\t\t}\n\n\t\tif (!user) {\n\t\t\tlogger.debug({ msg: 'User is not allowed to access Rocket.Chat', username: loginRequest.username });\n\t\t\treturn new Meteor.Error('not-authorized', 'User is not authorized by crowd');\n\t\t}\n\n\t\tconst result = await crowd.updateUserCollection(user);\n\n\t\treturn result;\n\t} catch (err: any) {\n\t\tlogger.error({ msg: 'Crowd user not authenticated due to an error', err });\n\n\t\tthrow new Meteor.Error('user-not-found', err.message);\n\t}\n});\n\nconst jobName = 'CROWD_Sync';\n\nMeteor.startup(() => {\n\tsettings.watchMultiple(['CROWD_Sync_User_Data', 'CROWD_Sync_Interval'], async function addCronJobDebounced([data, interval]) {\n\t\tif (data !== true) {\n\t\t\tlogger.info('Disabling CROWD Background Sync');\n\t\t\tif (await cronJobs.has(jobName)) {\n\t\t\t\tawait cronJobs.remove(jobName);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst crowd = new CROWD();\n\t\tif (interval) {\n\t\t\tif (await cronJobs.has(jobName)) {\n\t\t\t\tawait cronJobs.remove(jobName);","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/auth-providers/crowd/crowd.ts#L379-L415","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped message and the server log line 'Crowd user not authenticated due to an error' to get the underlying cause","Verify CROWD settings (URL, port, application name/password) and Crowd server reachability with curl from the Rocket.Chat host","Confirm the Rocket.Chat application is registered and allowed in Crowd and its credentials are current","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)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight Crowd connectivity before enabling the handler\nconst url = settings.get('CROWD_URL');\ntry {\n\tconst res = await fetch(`${url}/crowd/rest/usermanagement/1/session`);\n\tif (res.status === 401 || res.status === 404) {\n\t\tlogger.error('Crowd endpoint reachable but path/credentials look wrong');\n\t}\n} catch (e) {\n\tlogger.error('Crowd server unreachable', e);\n}","typeGuard":null,"tryCatchPattern":"try {\n\tawait loginWithCrowd(username, password);\n} catch (e) {\n\tif (e instanceof Meteor.Error && e.error === 'user-not-found') {\n\t\t// e.reason holds the real cause (connection refused, timeout, Crowd API error)\n\t\t// surface a generic 'SSO unavailable' message; alert ops with e.reason\n\t} else throw e;\n}","preventionTips":["Monitor Crowd server reachability from the Rocket.Chat host (synthetic check)","Keep CROWD_URL, application name and password in sync with Crowd's application registry","Remember this handler wraps ALL Crowd failures as user-not-found — always log e.reason for diagnosis"],"tags":["crowd","sso","external-auth","network","configuration"],"backgroundTag":"external-auth-backend-unreachable","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}