{"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":"error","filePath":"apps/meteor/server/api/v1/channels.ts","lineNumber":111,"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":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/api/v1/channels.ts#L93-L129","documentation":"Thrown by findChannelByIdOrName when the caller passed checkedArchived: true and the resolved channel has archived set. The endpoint explicitly opts into archived-channel protection (most write operations like channels.join, channels.invite, channels.addAll use it), so modifying or joining an archived channel is rejected.","triggerScenarios":"Calling channels.invite, channels.join, channels.addAll, channels.setTopic, etc. (endpoints that pass checkedArchived) against a channel an admin archived earlier; unarchive race where the channel is re-archived between the UI load and the API call.","commonSituations":"Automation scripts iterate over stale channel lists that include archived rooms; admin archived the channel without announcing it; trying to post or add users to read-only historical channels.","solutions":["Unarchive first via POST /api/v1/channels.unarchive, then retry the original call","Filter archived rooms out of batch jobs by checking the archived flag from channels.list before operating","In user-facing flows, detect this error and show 'channel is archived' instead of retrying"],"exampleFix":"// before\nPOST /api/v1/channels.invite { roomId, userId } // error-room-archived\n\n// after\nawait POST('/api/v1/channels.unarchive', { roomId });\nawait POST('/api/v1/channels.invite', { roomId, userId });","handlingStrategy":"try-catch","validationCode":"const info = await GET('/api/v1/channels.info', { roomId });\nif (info.channel.archived) {\n  await POST('/api/v1/channels.unarchive', { roomId });\n}","typeGuard":"const isArchived = (channel: { archived?: boolean }): boolean => Boolean(channel.archived);","tryCatchPattern":"try { /* channels.* write */ } catch (e) {\n  if (e.error === 'error-room-archived') {\n    await POST('/api/v1/channels.unarchive', { roomId });\n    return retryOriginalCall();\n  }\n}","preventionTips":["Filter archived channels out of bulk operations using the archived flag from channels.list","Check archive state before joining/inviting in automations"],"tags":["rest-api","channels","archived","rocket-chat"],"backgroundTag":"archived-resource","analyzedSha":"e4b8178b205510181a96ceefee043d0abcd13e5a","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}