{"record":{"id":"e5db9c0fb6a86f17","repo":"RocketChat/Rocket.Chat","slug":"error-license-user-limit-reached-e5db9c","errorCode":"error-license-user-limit-reached","errorMessage":"The maximum number of users has been reached.","messagePattern":"The maximum number of users has been reached\\.","errorType":"error_code","errorClass":"MeteorError","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/lib/authorization/validateUserRoles.ts","lineNumber":50,"sourceCode":"\tif (isGuest) {\n\t\treturn;\n\t}\n\n\tconst isActive = Boolean(userData.active !== false);\n\tconst wasActive = currentUserData && currentUserData?.active !== false;\n\n\tconst hasRemovedSpecialType = (wasApp && !isApp) || (wasBot && !isBot);\n\n\tif (!isActive) {\n\t\treturn;\n\t}\n\n\tif (!hasRemovedSpecialType && wasActive) {\n\t\treturn;\n\t}\n\n\tif (await License.shouldPreventAction('activeUsers')) {\n\t\tthrow new MeteorError('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached'));\n\t}\n}\n","sourceCodeStart":32,"sourceCodeEnd":53,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/lib/authorization/validateUserRoles.ts#L32-L53","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Deactivate other users until the active user count is below the licensed seat count, then retry the operation","Apply a license with more seats (Administration -> License) or renew the expired one","Verify the applied license and its activeUsers limit via the license info endpoint before retrying","Keep the user inactive or preserve its bot/app special type instead of activating it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { License } from '@rocket.chat/license';\n\nconst canActivateUser = async (): Promise<boolean> => !(await License.shouldPreventAction('activeUsers'));\n\nif (!(await canActivateUser())) {\n\t// block activation and surface a 'user limit reached' notice instead of saving\n}","typeGuard":null,"tryCatchPattern":"try {\n\tawait setUserActive(user._id, true);\n} catch (err) {\n\tif (err instanceof MeteorError && err.code === 'error-license-user-limit-reached') {\n\t\t// show seat-limit UI, do not retry until seats free or license upgraded\n\t} else {\n\t\tthrow err;\n\t}\n}","preventionTips":["Monitor active user count against the licensed seat count with a periodic check","Prefer deactivation over deletion of bot/app special types when near the seat limit","Alert admins before the license seat count is reached so activations never fail mid-operation"],"tags":["license","user-management","enterprise","seats"],"backgroundTag":"license-seat-limit-reached","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}