RocketChat/Rocket.Chat · error · Meteor.Error

error-direct-room

error-direct-room

Error message

Can't change type of direct rooms

What it means

Error "Can't change type of direct rooms" thrown in RocketChat/Rocket.Chat.

Source

Thrown at apps/meteor/server/lib/rooms/settings/saveRoomType.ts:40

			function: 'RocketChat.saveRoomType',
		});
	}
	if (roomType !== 'c' && roomType !== 'p') {
		throw new Meteor.Error('error-invalid-room-type', 'error-invalid-room-type', {
			function: 'RocketChat.saveRoomType',
			type: roomType,
		});
	}
	const room = await Rooms.findOneById(rid);
	if (room == null) {
		throw new Meteor.Error('error-invalid-room', 'error-invalid-room', {
			function: 'RocketChat.saveRoomType',
			_id: rid,
		});
	}

	if (!(await roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange(room, RoomSettingsEnum.TYPE))) {
		throw new Meteor.Error('error-direct-room', "Can't change type of direct rooms", {
			function: 'RocketChat.saveRoomType',
		});
	}

	const result = await Promise.all([Rooms.setTypeById(rid, roomType), Subscriptions.updateTypeByRoomId(rid, roomType)]);

	if (!result) {
		return result;
	}

	if (roomType === 'c' && room.abacAttributes?.length) {
		await Rooms.unsetAbacAttributesById(rid);
	}

	if (result[1]?.modifiedCount) {
		void notifyOnSubscriptionChangedByRoomId(rid);
	}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Do not attempt to change the type of a direct message room; only channels and private groups can be converted.

When it happens

Trigger: Thrown in saveRoomType when attempting to convert a direct message room, which is not allowed.

Common situations: See trigger scenarios.


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