RocketChat/Rocket.Chat · error · MeteorError

error-license-user-limit-reached

error-license-user-limit-reached

Error message

error-license-user-limit-reached

What it means

Thrown by the `beforeActivateUser` callback when `License.shouldPreventAction('activeUsers')` resolves truthy, meaning activating another user would exceed the licensed active-user cap. It uses a `MeteorError` with code `error-license-user-limit-reached` and a localized message via `i18n.t`. The hook runs at HIGH priority under the name `validateUserStatus`.

Source

Thrown at apps/meteor/ee/server/hooks/auth/callback.ts:50

		callbacks.priority.HIGH,
		'validateUserRoles',
	);

	callbacks.add(
		'afterDeactivateUser',
		async (user) => {
			await License.shouldPreventAction('activeUsers');
			return user;
		},
		callbacks.priority.HIGH,
		'validateUserStatus',
	);

	callbacks.add(
		'beforeActivateUser',
		async () => {
			if (await License.shouldPreventAction('activeUsers')) {
				throw new MeteorError('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached'));
			}
			return undefined;
		},
		callbacks.priority.HIGH,
		'validateUserStatus',
	);
});

License.onInvalidate(() => {
	callbacks.remove('beforeSaveUser', 'validateUserRoles');
	callbacks.remove('afterSaveUser', 'validateUserRoles');
	callbacks.remove('afterDeleteUser', 'validateUserRoles');

	callbacks.remove('afterDeactivateUser', 'validateUserStatus');
	callbacks.remove('beforeActivateUser', 'validateUserStatus');
});

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Reduce the active user count: deactivate users no longer needed before activating new ones.
  2. Upgrade the license to a higher active-user tier.
  3. Audit which users are active (`Users.find({ active: true })`) and reconcile against the licensed seat count.
Defensive patterns

Strategy: validation

Validate before calling

import { License } from '../../license/license';

async function canActivateUser(): Promise<boolean> {
	return !(await License.shouldPreventAction('activeUsers'));
}

Type guard

function isLicenseUserLimitError(e: unknown): boolean {
	return e instanceof Meteor.Error && (e as Meteor.Error).error === 'error-license-user-limit-reached';
}

Try / catch

try {
	await activateUser(user);
} catch (e) {
	if (e instanceof Meteor.Error && e.error === 'error-license-user-limit-reached') {
		// deactivate another user or upgrade license
	}
	throw e;
}

Prevention

When it happens

Trigger: Activating a user (e.g. admin activates a disabled user, or a user self-activates) when the active user count is already at or above the license limit, so `License.shouldPreventAction('activeUsers')` returns true.

Common situations: License tier limit reached (e.g. 500 active users on a 500-seat license); license downgraded to a smaller seat count while more users are already active; bulk user import/activation hitting the cap.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/9e526c1b649855df. Report an issue: GitHub.