{"record":{"id":"bf978bc6070b687b","repo":"RocketChat/Rocket.Chat","slug":"error-room-archived","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/channels.ts","lineNumber":110,"sourceCode":"\t\t  };\n\tuserId?: string;\n\tcheckedArchived?: boolean;\n}): Promise<IRoom> {\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 || (room.t !== 'c' && room.t !== 'l')) {\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\n\tif (checkedArchived && room.archived) {\n\t\tthrow new Meteor.Error('error-room-archived', `The channel, ${room.name}, is archived`);\n\t}\n\tif (userId && room.lastMessage) {\n\t\tconst [lastMessage] = await normalizeMessagesForUser([room.lastMessage], userId);\n\t\troom.lastMessage = lastMessage;\n\t}\n\n\treturn room;\n}\n\nconst channelResponseSchema = ajv.compile<{ channel: IRoom }>({\n\ttype: 'object',\n\tproperties: {\n\t\tchannel: { $ref: '#/components/schemas/IRoom' },\n\t\tsuccess: { type: 'boolean', enum: [true] },\n\t},\n\trequired: ['channel', 'success'],\n\tadditionalProperties: false,\n});","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/channels.ts#L92-L128","documentation":"Thrown by findChannelByIdOrName when checkedArchived is true and the resolved channel has room.archived set. The channel name is interpolated into the message. This is a soft state guard, not an auth failure - the channel exists and is readable, but it has been archived.","triggerScenarios":"Calling a channels.* endpoint that passes checkedArchived: true (e.g., channels.info) against a channel whose archived flag is true.","commonSituations":"Operating on a channel that an admin archived mid-session; automation targeting a channel after a retention policy archived it; UI not refreshing the archived state.","solutions":["Pass checkedArchived: false (or omit it) when the operation is valid on archived channels.","Detect archived state upstream and surface a 'read-only / archived' UI instead of attempting writes.","Unarchive the channel via the administration tools if the workflow requires it."],"exampleFix":"// before\nconst room = await findChannelByIdOrName({\n  params: { roomId },\n  checkedArchived: true,\n});\n\n// after - allow archived rooms where the operation is permitted\nconst room = await findChannelByIdOrName({\n  params: { roomId },\n  checkedArchived: false,\n});\nif (room.archived) {\n  // surface archived state to the user explicitly\n}","handlingStrategy":"validation","validationCode":"// Check archived state before calling endpoints that reject archived rooms\nasync function getChannelIfActive(roomId) {\n  const room = await Rooms.findOneById(roomId);\n  if (!room) throw new Error('Room not found');\n  if (room.archived) return { archived: true, room };\n  return { archived: false, room };\n}","typeGuard":"function isArchivedRoom(room) {\n  return Boolean(room) && Boolean(room.archived);\n}","tryCatchPattern":"try {\n  return await api.channels.info({ roomId });\n} catch (e) {\n  if (e.error === 'error-room-archived') {\n    // surface archived state to the UI instead of failing\n    return { archived: true };\n  }\n  throw e;\n}","preventionTips":["Detect archived state upstream and disable write actions in the UI.","Pass checkedArchived: false only when the operation is valid on archived rooms.","Refresh room state after admin actions that may archive."],"tags":["channels","archived","room-state","rest-api"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}