RocketChat/Rocket.Chat · error · Meteor.Error

error-max-rooms-per-guest-reached

error-max-rooms-per-guest-reached

Error message

error-max-rooms-per-guest-reached

What it means

Thrown by the 'beforeAddedToRoom' callback registered in maxRoomsPerGuest when a guest user is about to be added to a room and License.shouldPreventAction('roomsPerGuest', 1, ...) returns true. This is an Enterprise license enforcement: it caps how many rooms a single guest can belong to. The extraCount of 1 simulates the additional room, so it triggers before the guest actually exceeds the cap.

Source

Thrown at apps/meteor/ee/server/startup/maxRoomsPerGuest.ts:14

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

import { callbacks } from '../../../server/lib/callbacks';
import { i18n } from '../../../server/lib/i18n';

callbacks.add(
	'beforeAddedToRoom',
	async ({ user }) => {
		if (user.roles?.includes('guest')) {
			// extraCount = 1 checks if adding one more room would exceed the limit
			// (not if they've already exceeded it, since this runs before adding them to the room)
			if (await License.shouldPreventAction('roomsPerGuest', 1, { userId: user._id })) {
				throw new Meteor.Error('error-max-rooms-per-guest-reached', i18n.t('error-max-rooms-per-guest-reached'));
			}
		}
	},
	callbacks.priority.MEDIUM,
	'check-max-rooms-per-guest',
);

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Remove the guest from an existing room before adding them to a new one.
  2. Raise the roomsPerGuest limit on the license / workspace settings if your plan allows.
  3. Convert the user from 'guest' to a full user role if they need more rooms.
  4. Contact Rocket.Chat sales/support to adjust the license entitlement.
Defensive patterns

Strategy: validation

Validate before calling

async function wouldExceedGuestRoomLimit(userId: string): Promise<boolean> {
  return License.shouldPreventAction('roomsPerGuest', 1, { userId });
}

Try / catch

try {
  await addGuestToRoom(guestId, roomId);
} catch (e) {
  if (e.error === 'error-max-rooms-per-guest-reached') {
    // notify agent that the guest is at the room cap
  } else throw e;
}

Prevention

When it happens

Trigger: Adding a guest user to a new omnichannel room when their current room count is already at the licensed roomsPerGuest limit; the workspace has an Enterprise license with a per-guest room cap configured.

Common situations: Guest user already in the maximum number of rooms and a new chat/room assignment is attempted; license tier changed lowering the cap below existing usage; test/staging workspace with a low cap.

Related errors


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