RocketChat/Rocket.Chat · warning · Error

error-room-not-found

Error message

error-room-not-found

What it means

Thrown by GET push.get after a message was found but Rooms.findOneById(message.rid) returns null. This indicates a data-integrity problem: the message exists but references a room that no longer exists (orphaned message). It is a plain new Error, so it is not a structured Meteor error response.

Source

Thrown at apps/meteor/server/api/v1/push.ts:316

				401: validateUnauthorizedErrorResponse,
			},
		},
		async function action() {
			const { id } = this.queryParams;

			const receiver = await Users.findOneById(this.userId);
			if (!receiver) {
				throw new Error('error-user-not-found');
			}

			const message = await Messages.findOneById(id);
			if (!message) {
				throw new Error('error-message-not-found');
			}

			const room = await Rooms.findOneById(message.rid);
			if (!room) {
				throw new Error('error-room-not-found');
			}

			if (!(await canAccessRoomAsync(room, receiver))) {
				throw new Error('error-not-allowed');
			}

			const data = await PushNotification.getNotificationForMessageId({ receiver, room, message });

			return API.v1.success({ data });
		},
	)
	.get(
		'push.info',
		{
			authRequired: true,
			response: {
				200: pushInfoResponseSchema,
				401: validateUnauthorizedErrorResponse,

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Investigate the data integrity issue: query the Messages collection for messages whose rid has no matching Rooms document.
  2. Run the workspace's room/message cleanup or trash compaction to remove or repair orphaned messages.
  3. If reproducing on a restored DB, re-run the retention/prune job that synchronizes rooms and messages.
  4. On the client, treat this as a non-retryable server data state rather than a user input error.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await fetch(`/api/v1/push.get?id=${id}`).then(r => r.json());
} catch (e) {
  if (String(e).includes('error-room-not-found')) {
    // data-integrity issue: report to admin; do not retry
  }
}

Prevention

When it happens

Trigger: GET /api/v1/push.get?id=<id> where the message document's rid points to a room that has been deleted from the Rooms collection while the message row remains.

Common situations: Room deletion left orphaned message records (partial cleanup); data migration/restore inconsistency; a message referencing a rid that was never a real room (corrupt import).

Related errors


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