{"record":{"id":"1fce44efe5615d32","repo":"RocketChat/Rocket.Chat","slug":"error-room-archived-1fce44","errorCode":"error-room-archived","errorMessage":"The private group, ${roomName}, is archived","messagePattern":"The private group, (.+?), is archived","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/groups.ts","lineNumber":141,"sourceCode":"\topen: boolean;\n\tro: boolean;\n\tt: string;\n\tname: string;\n\tbroadcast: boolean;\n}> {\n\tconst room = await getRoomFromParams(params);\n\n\tconst user = await Users.findOneById(userId, { projection: { username: 1, roles: 1, abacAttributes: 1 } });\n\n\tif (!room || !user || !(await canAccessRoomAsync(room, user))) {\n\t\tthrow new Meteor.Error('error-room-not-found', 'The required \"roomId\" or \"roomName\" param provided does not match any group');\n\t}\n\n\t// discussions have their names saved on `fname` property\n\tconst roomName = room.prid ? room.fname : room.name;\n\n\tif (checkedArchived && room.archived) {\n\t\tthrow new Meteor.Error('error-room-archived', `The private group, ${roomName}, is archived`);\n\t}\n\n\tconst sub = await Subscriptions.findOneByRoomIdAndUserId(room._id, userId, { projection: { open: 1 } });\n\n\treturn {\n\t\trid: room._id,\n\t\topen: Boolean(sub?.open),\n\t\tro: Boolean(room.ro),\n\t\tt: room.t,\n\t\tname: roomName ?? '',\n\t\tbroadcast: Boolean(room.broadcast),\n\t};\n}\n\nconst groupResponseSchema = ajv.compile<{ group: IRoom }>({\n\ttype: 'object',\n\tproperties: {\n\t\tgroup: { $ref: '#/components/schemas/IRoom' },","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/api/v1/groups.ts#L123-L159","documentation":"Thrown by findPrivateGroupByIdOrName (default checkedArchived=true) when the resolved private group has archived=true. Mutating group endpoints routed through this helper - groups.addAll, addModerator/kick/roles, etc. - refuse to operate on archived groups, since an archived room is meant to be frozen read-only. Read-only endpoints such as groups.info call the helper with checkedArchived:false and do not hit this.","triggerScenarios":"POST groups.addAll or groups.addModerator against a group that an admin archived earlier; retrying an old automation payload after the workspace did a cleanup/archive sweep; the group being archived by another process between your rooms/info check and your mutation call.","commonSituations":"Compliance-driven archiving of old project groups while scheduled bots keep posting/inviting; migration scripts that assume all listed groups are active; admins testing archive behavior and forgetting to restore.","solutions":["Unarchive first with POST groups.unarchive { roomId }, then replay the original mutation","Skip archived rooms in automation by checking the archived flag from rooms/info or groups.list before acting","If the archive is intentional, treat this as the expected terminal state and stop the workflow for that room"],"exampleFix":"// before\nawait sdk.post('groups.addAll', { roomId }); // group is archived\n\n// after\nawait sdk.post('groups.unarchive', { roomId });\nawait sdk.post('groups.addAll', { roomId });","handlingStrategy":"validation","validationCode":"const { group } = await sdk.get('groups.info', { roomId });\nif (group.archived) {\n  await sdk.post('groups.unarchive', { roomId }); // only if reactivation is intended\n}","typeGuard":"const isArchived = (room: { archived?: boolean }): boolean => Boolean(room.archived);","tryCatchPattern":"try { await sdk.post('groups.addAll', { roomId }); } catch (e) {\n  if (e.error === 'error-room-archived') { /* decide: unarchive-and-retry, or stop the workflow */ }\n}","preventionTips":["Check the archived flag from groups.info/groups.list before mutating","Automations should treat archived as a terminal state unless a business rule says otherwise","Pair unarchive -> mutate -> archive sequences explicitly rather than assuming liveness"],"tags":["rest-api","groups","archived-room","room-state"],"backgroundTag":"room-archived","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"}