{"record":{"id":"86dfab2e5f1a0382","repo":"RocketChat/Rocket.Chat","slug":"error-room-not-found-86dfab","errorCode":null,"errorMessage":"error-room-not-found","messagePattern":"error-room-not-found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/api/v1/push.ts","lineNumber":316,"sourceCode":"\t\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t\t},\n\t\t},\n\t\tasync function action() {\n\t\t\tconst { id } = this.queryParams;\n\n\t\t\tconst receiver = await Users.findOneById(this.userId);\n\t\t\tif (!receiver) {\n\t\t\t\tthrow new Error('error-user-not-found');\n\t\t\t}\n\n\t\t\tconst message = await Messages.findOneById(id);\n\t\t\tif (!message) {\n\t\t\t\tthrow new Error('error-message-not-found');\n\t\t\t}\n\n\t\t\tconst room = await Rooms.findOneById(message.rid);\n\t\t\tif (!room) {\n\t\t\t\tthrow new Error('error-room-not-found');\n\t\t\t}\n\n\t\t\tif (!(await canAccessRoomAsync(room, receiver))) {\n\t\t\t\tthrow new Error('error-not-allowed');\n\t\t\t}\n\n\t\t\tconst data = await PushNotification.getNotificationForMessageId({ receiver, room, message });\n\n\t\t\treturn API.v1.success({ data });\n\t\t},\n\t)\n\t.get(\n\t\t'push.info',\n\t\t{\n\t\t\tauthRequired: true,\n\t\t\tresponse: {\n\t\t\t\t200: pushInfoResponseSchema,\n\t\t\t\t401: validateUnauthorizedErrorResponse,","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/push.ts#L298-L334","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Investigate the data integrity issue: query the Messages collection for messages whose rid has no matching Rooms document.","Run the workspace's room/message cleanup or trash compaction to remove or repair orphaned messages.","If reproducing on a restored DB, re-run the retention/prune job that synchronizes rooms and messages.","On the client, treat this as a non-retryable server data state rather than a user input error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await fetch(`/api/v1/push.get?id=${id}`).then(r => r.json());\n} catch (e) {\n  if (String(e).includes('error-room-not-found')) {\n    // data-integrity issue: report to admin; do not retry\n  }\n}","preventionTips":["This reflects server-side data corruption (orphaned message); report it rather than retrying.","Periodically run workspace integrity checks that flag messages whose rid has no room."],"tags":["push","rest-api","data-integrity","orphaned-message","not-found"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}