{"record":{"id":"46a7583bebb03d64","repo":"RocketChat/Rocket.Chat","slug":"error-room-archived-46a758","errorCode":"error-room-archived","errorMessage":"The channel, ${room.name}, is archived","messagePattern":"The channel, (.+?), is archived","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/api/v1/rooms.ts","lineNumber":130,"sourceCode":"\t\t('roomId' in params && !(params as { roomId?: string }).roomId && 'roomName' in params && !(params as { roomName?: string }).roomName)\n\t) {\n\t\tthrow new Meteor.Error('error-roomid-param-not-provided', 'The parameter \"roomId\" or \"roomName\" is required');\n\t}\n\n\tconst projection = { ...API.v1.defaultFieldsToExclude };\n\n\tlet room;\n\tif ('roomId' in params) {\n\t\troom = await Rooms.findOneById(params.roomId || '', { projection });\n\t} else if ('roomName' in params) {\n\t\troom = await Rooms.findOneByName(params.roomName || '', { projection });\n\t}\n\n\tif (!room) {\n\t\tthrow new Meteor.Error('error-room-not-found', 'The required \"roomId\" or \"roomName\" param provided does not match any channel');\n\t}\n\tif (checkedArchived && room.archived) {\n\t\tthrow new Meteor.Error('error-room-archived', `The channel, ${room.name}, is archived`);\n\t}\n\n\treturn room;\n}\n\nAPI.v1.get(\n\t'rooms.nameExists',\n\t{\n\t\tauthRequired: true,\n\t\tquery: isGETRoomsNameExists,\n\t\tresponse: {\n\t\t\t200: ajv.compile<{ exists: boolean }>({\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\texists: { type: 'boolean' },\n\t\t\t\t\tsuccess: { type: 'boolean', enum: [true] },\n\t\t\t\t},\n\t\t\t\trequired: ['exists', 'success'],","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/rooms.ts#L112-L148","documentation":"Thrown by findRoomByIdOrName when checkedArchived is true (the default) and the resolved room has room.archived === true. The room exists but is archived, so the operation is blocked. The room name is interpolated into the message. Returns a structured Meteor.Error('error-room-archived', ...).","triggerScenarios":"Calling a findRoomByIdOrName-backed endpoint (with default checkedArchived=true) for a room that has been archived by an admin.","commonSituations":"Posting/operating on a channel after it was archived; automation targeting a room that got archived between scheduling and execution.","solutions":["Unarchive the room first (rooms.unarchive) if the operation should proceed.","Pass checkedArchived=false where the calling endpoint exposes it, if archived rooms are legitimately in scope.","Filter archived rooms out of automation targets beforehand."],"exampleFix":"// before - default checkedArchived=true rejects archived room\nconst room = await findRoomByIdOrName({ params: { roomId } });\n\n// after - allow archived rooms when the caller supports it\nconst room = await findRoomByIdOrName({ params: { roomId }, checkedArchived: false });","handlingStrategy":"validation","validationCode":"// Skip or unarchive archived rooms before operating\nconst { room } = await fetch(`/api/v1/rooms.info?roomId=${encodeURIComponent(roomId)}`).then(r => r.json());\nif (room?.archived) {\n  await fetch('/api/v1/rooms.unarchive', { method:'POST', body: JSON.stringify({ roomId }) });\n}\n// proceed with the findRoomByIdOrName-backed call","typeGuard":"function isArchived(room: { archived?: boolean } | undefined): boolean {\n  return !!room?.archived;\n}","tryCatchPattern":"try {\n  await callFindRoomByIdOrName({ params: { roomId } });\n} catch (e) {\n  if (e.error === 'error-room-archived') { /* unarchive or skip */ }\n}","preventionTips":["Default checkedArchived is true; pass false only when archived rooms are in scope.","Unarchive rooms before operating if the action must proceed."],"tags":["rooms","rest-api","archived","business-rule"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}