RocketChat/Rocket.Chat · error · Meteor.Error
error-room-type-not-allowed
error-room-type-not-allowed
Error message
Cannot create invite links for this room type
What it means
Error "Cannot create invite links for this room type" thrown in RocketChat/Rocket.Chat.
Source
Thrown at apps/meteor/server/lib/rooms/invites/findOrCreateInvite.ts:74
}
const room = await Rooms.findOneById(invite.rid);
if (!room) {
throw new Meteor.Error('error-invalid-room', 'The rid field is invalid', {
method: 'findOrCreateInvite',
field: 'rid',
});
}
if (settings.get('ABAC_Enabled') && room?.abacAttributes?.length) {
throw new Meteor.Error('error-invalid-room', 'Room is ABAC managed', {
method: 'findOrCreateInvite',
field: 'rid',
});
}
if (!(await roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.INVITE, userId))) {
throw new Meteor.Error('error-room-type-not-allowed', 'Cannot create invite links for this room type', {
method: 'findOrCreateInvite',
});
}
const { days = 1, maxUses = 0 } = invite;
if (!possibleDays.includes(days)) {
throw new Meteor.Error('invalid-number-of-days', 'Invite should expire in 1, 7, 15 or 30 days, or send 0 to never expire.');
}
if (!possibleUses.includes(maxUses)) {
throw new Meteor.Error('invalid-number-of-uses', 'Invite should be valid for 1, 5, 10, 25, 50, 100 or infinite (0) uses.');
}
// Before anything, let's check if there's an existing invite with the same settings for the same channel and user and that has not yet expired.
const existing = await Invites.findOneByUserRoomMaxUsesAndExpiration(userId, invite.rid, maxUses, days);
// If an existing invite was found, return it's _id instead of creating a new one.View on GitHub (pinned to b2c16d5842)
Solutions
- Only create invite links for channels and groups; direct messages and other room types do not support invite links.
- Check room.t before calling findOrCreateInvite and reject unsupported types early.
When it happens
Trigger: Thrown when findOrCreateInvite is called for a room type that does not support invite links (e.g. direct messages or other non-channel/group types).
Common situations: See trigger scenarios.
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/d489ea1c1a804ab4.
Report an issue: GitHub.