RocketChat/Rocket.Chat · warning

LDAP Host is not configured.

Error message

LDAP Host is not configured.

What it means

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.

Source

Thrown at apps/meteor/server/lib/ldap/Connection.ts:103

			groupFilterGroupMemberFormat: settings.get<string>('LDAP_Group_Filter_Group_Member_Format'),
			groupFilterGroupName: settings.get<string>('LDAP_Group_Filter_Group_Name'),
			authentication: settings.get<boolean>('LDAP_Authentication') ?? false,
			authenticationUserDN: settings.get<string>('LDAP_Authentication_UserDN') ?? '',
			authenticationPassword: settings.get<string>('LDAP_Authentication_Password') ?? '',
			useVariables: settings.get<boolean>('LDAP_DataSync_UseVariables') ?? false,
			variableMap: settings.get<string>('LDAP_DataSync_VariableMap') ?? '{}',
			attributesToQuery: this.parseAttributeList(settings.get<string>('LDAP_User_Search_AttributesToQuery')),
		};

		this._variableMap =
			(this.options.useVariables &&
				wrapExceptions(() => JSON.parse(this.options.variableMap)).suppress(() => {
					mapLogger.error({ msg: 'Failed to parse LDAP Variable Map', map: this.options.variableMap });
				})) ||
			{};

		if (!this.options.host) {
			logger.warn('LDAP Host is not configured.');
		}
		if (!this.options.baseDN) {
			logger.warn('LDAP Search BaseDN is not configured.');
		}
	}

	public async connect(): Promise<any> {
		return new Promise((resolve, reject) => {
			this.initializeConnection((error, result) => {
				if (error) {
					return reject(error);
				}

				return resolve(result);
			});
		});
	}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Set Administration > LDAP > Host (LDAP_Host) to your directory server, e.g. 'ldap.corp.example.com' or 'ldaps://ldap.corp.example.com:636'
  2. If LDAP was enabled by accident, set LDAP_Enable=false so no Connection is constructed
  3. 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
  4. Retry the LDAP login/sync and check for follow-up connection errors to confirm resolution

Example fix

// before (Admin > LDAP)
LDAP_Enable: true
LDAP_Host: ''

// after
LDAP_Enable: true
LDAP_Host: 'ldaps://ldap.corp.example.com:636'
Defensive patterns

Strategy: validation

Validate before calling

import { settings } from 'meteor/rocketchat:settings-server';

const host = settings.get<string>('LDAP_Host')?.trim();
if (settings.get('LDAP_Enable') && !host) {
  throw new Error('LDAP is enabled but LDAP_Host is empty — configure the host before enabling LDAP login/sync');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/b7ea7f4c336a132b. Report an issue: GitHub.