RocketChat/Rocket.Chat · error · MeteorError

error-license-user-limit-reached

error-license-user-limit-reached

Error message

The maximum number of users has been reached.

What it means

Thrown by Rocket.Chat Enterprise licensing when saving a user would push the active user count past the licensed seat limit. validateUserRoles only runs this check on the transition to active: the user was previously inactive, or it just lost its app/bot special type (app and bot users do not count against seats). If License.shouldPreventAction('activeUsers') is true at that moment, the save is rejected with error-license-user-limit-reached.

Solutions

  1. Deactivate other users until the active user count is below the licensed seat count, then retry the operation
  2. Apply a license with more seats (Administration -> License) or renew the expired one
  3. Verify the applied license and its activeUsers limit via the license info endpoint before retrying
  4. Keep the user inactive or preserve its bot/app special type instead of activating it
Defensive patterns

Strategy: validation

Validate before calling

import { License } from '@rocket.chat/license';

const canActivateUser = async (): Promise<boolean> => !(await License.shouldPreventAction('activeUsers'));

if (!(await canActivateUser())) {
	// block activation and surface a 'user limit reached' notice instead of saving
}

Try / catch

try {
	await setUserActive(user._id, true);
} catch (err) {
	if (err instanceof MeteorError && err.code === 'error-license-user-limit-reached') {
		// show seat-limit UI, do not retry until seats free or license upgraded
	} else {
		throw err;
	}
}

Prevention

When it happens

Trigger: Activating a deactivated user, or converting an app/bot user into a regular user (wasApp/wasBot flags removed), while the number of active users already equals or exceeds the license's activeUsers limit.

Common situations: Expired or downsized Enterprise license after renewal; trial license that lapsed; admin re-activating offboarded users; changing a bot user's type to a normal account on a full workspace.

Related errors


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

Appendix: source

Thrown at apps/meteor/ee/server/lib/authorization/validateUserRoles.ts:50

	if (isGuest) {
		return;
	}

	const isActive = Boolean(userData.active !== false);
	const wasActive = currentUserData && currentUserData?.active !== false;

	const hasRemovedSpecialType = (wasApp && !isApp) || (wasBot && !isBot);

	if (!isActive) {
		return;
	}

	if (!hasRemovedSpecialType && wasActive) {
		return;
	}

	if (await License.shouldPreventAction('activeUsers')) {
		throw new MeteorError('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached'));
	}
}

View on GitHub (pinned to b2c16d5842)