{"record":{"id":"b7ea7f4c336a132b","repo":"RocketChat/Rocket.Chat","slug":"ldap-host-is-not-configured","errorCode":null,"errorMessage":"LDAP Host is not configured.","messagePattern":"LDAP Host is not configured\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/ldap/Connection.ts","lineNumber":103,"sourceCode":"\t\t\tgroupFilterGroupMemberFormat: settings.get<string>('LDAP_Group_Filter_Group_Member_Format'),\n\t\t\tgroupFilterGroupName: settings.get<string>('LDAP_Group_Filter_Group_Name'),\n\t\t\tauthentication: settings.get<boolean>('LDAP_Authentication') ?? false,\n\t\t\tauthenticationUserDN: settings.get<string>('LDAP_Authentication_UserDN') ?? '',\n\t\t\tauthenticationPassword: settings.get<string>('LDAP_Authentication_Password') ?? '',\n\t\t\tuseVariables: settings.get<boolean>('LDAP_DataSync_UseVariables') ?? false,\n\t\t\tvariableMap: settings.get<string>('LDAP_DataSync_VariableMap') ?? '{}',\n\t\t\tattributesToQuery: this.parseAttributeList(settings.get<string>('LDAP_User_Search_AttributesToQuery')),\n\t\t};\n\n\t\tthis._variableMap =\n\t\t\t(this.options.useVariables &&\n\t\t\t\twrapExceptions(() => JSON.parse(this.options.variableMap)).suppress(() => {\n\t\t\t\t\tmapLogger.error({ msg: 'Failed to parse LDAP Variable Map', map: this.options.variableMap });\n\t\t\t\t})) ||\n\t\t\t{};\n\n\t\tif (!this.options.host) {\n\t\t\tlogger.warn('LDAP Host is not configured.');\n\t\t}\n\t\tif (!this.options.baseDN) {\n\t\t\tlogger.warn('LDAP Search BaseDN is not configured.');\n\t\t}\n\t}\n\n\tpublic async connect(): Promise<any> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.initializeConnection((error, result) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treturn reject(error);\n\t\t\t\t}\n\n\t\t\t\treturn resolve(result);\n\t\t\t});\n\t\t});\n\t}\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/ldap/Connection.ts#L85-L121","documentation":"Logged by the LDAP Connection constructor when the LDAP_Host setting resolves to an empty value. The connection options object is still built, but every LDAP operation that needs a directory server (login, user sync, search) will fail or no-op until a host is set. This is an early configuration sanity warning, not a failure of the LDAP client library itself.","triggerScenarios":"A new Connection is constructed (LDAP login attempt, LDAP_DataSync job, or user search) while settings.get('LDAP_Host') returns undefined/empty string — typically LDAP_Enable=true but the Host field was never filled in Administration > LDAP.","commonSituations":"Enabling LDAP before filling the Host field; clearing LDAP_Host while leaving LDAP enabled; pasting the host into the wrong field (e.g. Base DN); fresh installs where the settings collection has no LDAP_Host value yet.","solutions":["Set Administration > LDAP > Host (LDAP_Host) to your directory server, e.g. 'ldap.corp.example.com' or 'ldaps://ldap.corp.example.com:636'","If LDAP was enabled by accident, set LDAP_Enable=false so no Connection is constructed","If the warning persists after saving, verify the value reached the database (rocketchat_settings collection) — a failed settings save or read-replica lag can keep it empty","Retry the LDAP login/sync and check for follow-up connection errors to confirm resolution"],"exampleFix":"// before (Admin > LDAP)\nLDAP_Enable: true\nLDAP_Host: ''\n\n// after\nLDAP_Enable: true\nLDAP_Host: 'ldaps://ldap.corp.example.com:636'","handlingStrategy":"validation","validationCode":"import { settings } from 'meteor/rocketchat:settings-server';\n\nconst host = settings.get<string>('LDAP_Host')?.trim();\nif (settings.get('LDAP_Enable') && !host) {\n  throw new Error('LDAP is enabled but LDAP_Host is empty — configure the host before enabling LDAP login/sync');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat LDAP_Host as a required companion of LDAP_Enable: never enable one without the other","Add a config audit step (script or startup check) that reports empty critical LDAP settings","Test with a single LDAP login right after setup instead of enabling sync for the whole directory"],"tags":["ldap","configuration","settings","setup"],"backgroundTag":"missing-required-setting","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"}