RocketChat/Rocket.Chat · error · Error
room-not-on-that-team
Error message
room-not-on-that-team
What it means
Error "room-not-on-that-team" thrown in RocketChat/Rocket.Chat.
Source
Thrown at apps/meteor/server/services/team/service.ts:404
const user = await Users.findOneById(uid);
if (!user) {
throw new Error('invalid-user');
}
if (!canRemoveAnyRoom) {
const canSeeRoom = await Authorization.canAccessRoom(room, user);
if (!canSeeRoom) {
throw new Error('invalid-room');
}
}
const team = await Team.findOneById<Pick<ITeam, '_id' | 'roomId'>>(teamId, { projection: { _id: 1, roomId: 1 } });
if (!team) {
throw new Error('invalid-team');
}
if (room.teamId !== teamId) {
throw new Error('room-not-on-that-team');
}
delete room.teamId;
delete room.teamDefault;
await Rooms.unsetTeamById(room._id);
void notifyOnRoomChangedById(room._id, 'updated');
if (room.t === 'c') {
await Message.saveSystemMessage('user-removed-room-from-team', team.roomId, room.name || '', user);
}
return {
...room,
};
}
async unsetTeamIdOfRooms(user: AtLeast<IUser, '_id' | 'username' | 'name'>, team: AtLeast<ITeam, '_id' | 'roomId'>): Promise<void> {
if (!team) {View on GitHub (pinned to e4b8178b20)
Solutions
- Verify the room actually belongs to the given teamId before attempting removal.
- Use the correct teamId matching the room's teamId, or remove the room from the team it currently belongs to.
When it happens
Trigger: Thrown at apps/meteor/server/services/team/service.ts:402 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of RocketChat/Rocket.Chat@e4b8178b20 (2026-08-18).
Data as JSON: /api/errors/c50dffa899e9b311.
Report an issue: GitHub.