{"record":{"id":"d29da3468f37db9f","repo":"RocketChat/Rocket.Chat","slug":"crowd-disabled","errorCode":"crowd_disabled","errorMessage":"crowd_disabled","messagePattern":"crowd_disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/meteor-methods/auth/crowd.ts","lineNumber":34,"sourceCode":"}\n\nMeteor.methods<ServerMethods>({\n\tasync crowd_test_connection() {\n\t\tconst user = await Meteor.userAsync();\n\t\tif (!user) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user', {\n\t\t\t\tmethod: 'crowd_test_connection',\n\t\t\t});\n\t\t}\n\n\t\tif (!(await hasPermissionAsync(user, 'test-admin-options'))) {\n\t\t\tthrow new Meteor.Error('error-not-authorized', 'Not authorized', {\n\t\t\t\tmethod: 'crowd_test_connection',\n\t\t\t});\n\t\t}\n\n\t\tif (settings.get('CROWD_Enable') !== true) {\n\t\t\tthrow new Meteor.Error('crowd_disabled');\n\t\t}\n\n\t\ttry {\n\t\t\tconst crowd = new CROWD();\n\t\t\tawait crowd.checkConnection();\n\n\t\t\treturn {\n\t\t\t\tmessage: 'Crowd_Connection_successful' as const,\n\t\t\t\tparams: [],\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tlogger.error({\n\t\t\t\tmsg: 'Invalid crowd connection details, check the url and application username/password and make sure this server is allowed to speak to crowd',\n\t\t\t\terr,\n\t\t\t});\n\t\t\tthrow new Meteor.Error('Invalid connection details', '', { method: 'crowd_test_connection' });\n\t\t}\n\t},","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/auth/crowd.ts#L16-L52","documentation":"crowd_test_connection reads the CROWD_Enable setting and throws 'crowd_disabled' when it is not exactly true. The connection test is refused until the Crowd integration is switched on, so credentials cannot be tested against a disabled integration.","triggerScenarios":"Clicking Test Connection on the Crowd settings screen while the CROWD_Enable toggle is off; calling the method programmatically before enabling the integration; a multi-instance deployment where the setting differs between nodes.","commonSituations":"Testing credentials before flipping the enable toggle; settings reset after a backup restore; instances reading different settings databases.","solutions":["Enable CROWD_Enable in the admin LDAP/CROWD settings and save before testing","Save the settings form first, then run Test Connection","In multi-instance setups, confirm every instance reads the same settings source"],"exampleFix":"// before — integration disabled\nawait Meteor.callAsync('crowd_test_connection'); // throws crowd_disabled\n\n// after — enable first, then test (Admin -> LDAP -> CROWD toggle, or server-side:)\nawait settings.updateById('CROWD_Enable', true);\nawait Meteor.callAsync('crowd_test_connection');","handlingStrategy":"validation","validationCode":"// server-side: confirm the integration is on before testing\nif (settings.get('CROWD_Enable') !== true) {\n  throw new Error('Enable CROWD before testing the connection');\n}\nawait Meteor.callAsync('crowd_test_connection');","typeGuard":"const isMeteorErrorCode = (e: unknown, code: string): e is Meteor.Error => e instanceof Meteor.Error && e.error === code;","tryCatchPattern":"try {\n  await Meteor.callAsync('crowd_test_connection');\n} catch (err) {\n  if (isMeteorErrorCode(err, 'crowd_disabled')) {\n    // prompt the user to enable and save CROWD settings first, then retry\n  }\n}","preventionTips":["Save and enable the integration before exposing a Test Connection action","In multi-instance deployments, verify the setting is consistent across nodes"],"tags":["crowd","configuration","settings","feature-flag"],"backgroundTag":"feature-flag-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}