{"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":"warning","filePath":"apps/meteor/server/api/v1/groups.ts","lineNumber":140,"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":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/groups.ts#L122-L158","documentation":"Thrown by findPrivateGroupByIdOrName (groups.ts:139-141) when checkedArchived is not disabled (default true) and the resolved private group has room.archived === true. It blocks mutations against groups that have been archived, since archived groups are read-only by design. Endpoints that explicitly pass checkedArchived:false (e.g. groups.info) bypass this and instead surface archival through the returned payload.","triggerScenarios":"Calling any groups.* mutation routed through the helper with checkedArchived defaulted (addModerator, addOwner, kick, rename, setCustomFields, setDescription, setTopic, setReadOnly, setType, setEncrypted, etc.) against a group whose archived flag is true.","commonSituations":"An admin archived the group but a client/bot still holds the roomId and keeps issuing edits. A workflow archives groups on a schedule and an async job races with it. CI seeds an archived fixture and forgets to unarchive it before mutating.","solutions":["Unarchive the group first: POST groups.unarchive (executeUnarchiveRoom) or use the unarchive meteor method, then retry.","If archival was unintended, have an owner unarchive via the UI/Admin panel and confirm room.archived === false before re-issuing the call.","For read-only inspection, use groups.info (checkedArchived:false) which returns the group instead of throwing.","Treat archived groups as terminal in your client logic and stop issuing mutations once you observe archived === true."],"exampleFix":"// before\nawait POST('/api/v1/groups.rename', { roomId, name }); // group is archived -> error-room-archived\n\n// after\nawait POST('/api/v1/groups.unarchive', { roomId });\nawait POST('/api/v1/groups.rename', { roomId, name });","handlingStrategy":"validation","validationCode":"// Pre-flight: ensure the group is not archived before mutating.\nconst info = await api.get('/api/v1/groups.info', { roomId }); // checkedArchived:false\nif (info.group.archived) {\n  throw new Error(`Group ${info.group.name} is archived; unarchive first`);\n}\nawait api.post('/api/v1/groups.rename', { roomId, name });","typeGuard":"function isArchived(room) {\n  return Boolean(room && room.archived === true);\n}","tryCatchPattern":"try {\n  await api.post('/api/v1/groups.rename', { roomId, name });\n} catch (e) {\n  if (isMeteorError(e) && e.reason === 'error-room-archived') {\n    // optionally unarchive and retry, or surface archived state to UI\n  }\n  throw e;\n}","preventionTips":["Cache room.archived on the client and disable mutation controls when true.","Filter archived groups out of admin automation target lists.","Use groups.info (archived-tolerant) to inspect, mutation endpoints to change.","Coordinate archival timing with any in-flight automation."],"tags":["rest-api","groups","archived","lifecycle"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}