RocketChat/Rocket.Chat · error · Error

Room with id ${transferData.room} not found

Error message

Room with id ${transferData.room} not found

What it means

On the IPostLivechatRoomTransferred event (listeners.ts:434-444), AppListenerBridge resolves the room via `rooms.convertById(transferData.room)` and the from/to entities before dispatching to App listeners. If the room resolves to undefined it throws and the event is not delivered to apps.

Source

Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:443

				const [agentData] = args.payload;
				return this.orch
					.getManager()
					.getListenerManager()
					.executeListener(args.event, {
						room: (await this.orch.getConverters().get('rooms').convertRoom(agentData.room)) as IAppsLivechatRoom,
						agent: this.orch.getConverters().get('users').convertToApp(agentData.user),
					});

			case AppInterface.IPostLivechatRoomTransferred: {
				const [transferData] = args.payload;
				const converter = transferData.type === LivechatTransferEventType.AGENT ? 'users' : 'departments';

				const room = await this.orch.getConverters().get('rooms').convertById(transferData.room);
				const from = await this.orch.getConverters().get(converter).convertById(transferData.from);
				const to = await this.orch.getConverters().get(converter).convertById(transferData.to);

				if (!room) {
					throw new Error(`Room with id ${transferData.room} not found`);
				}

				if (!to) {
					throw new Error(`Transfer to entity with id ${transferData.to} not found`);
				}

				return this.orch
					.getManager()
					.getListenerManager()
					.executeListener(args.event, {
						room,
						from: from as NonNullable<typeof from>, // type definition in the apps-engine seems to be incorrect
						to,
						type: transferData.type,
					});
			}

			case AppInterface.IPostLivechatGuestSaved: {

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Verify the room with id transferData.room exists at dispatch time.
  2. Investigate data integrity / replication lag if the failure is intermittent.
  3. Ensure transfer payloads carry the correct, current room id.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await appListenerBridge.handleEvent({ event: AppInterface.IPostLivechatRoomTransferred, payload: [transferData] });
} catch (e) {
  if (e instanceof Error && /Room with id .* not found/.test(e.message)) {
    logger.warn({ msg: 'Transfer event skipped: room missing', roomId: transferData.room });
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: transferData.room references a room that was deleted, never existed, or could not be read (e.g. replication lag / DB unavailability) at dispatch time.

Common situations: Race between room deletion and the transfer event; data-integrity issue; wrong id in the transfer payload; converter returning undefined due to a partial room document.

Related errors


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