RocketChat/Rocket.Chat · warning · Meteor.Error

error-room-archived

error-room-archived

Error message

The channel, ${room.name}, is archived

What it means

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', ...).

Source

Thrown at apps/meteor/server/api/v1/rooms.ts:130

		('roomId' in params && !(params as { roomId?: string }).roomId && 'roomName' in params && !(params as { roomName?: string }).roomName)
	) {
		throw new Meteor.Error('error-roomid-param-not-provided', 'The parameter "roomId" or "roomName" is required');
	}

	const projection = { ...API.v1.defaultFieldsToExclude };

	let room;
	if ('roomId' in params) {
		room = await Rooms.findOneById(params.roomId || '', { projection });
	} else if ('roomName' in params) {
		room = await Rooms.findOneByName(params.roomName || '', { projection });
	}

	if (!room) {
		throw new Meteor.Error('error-room-not-found', 'The required "roomId" or "roomName" param provided does not match any channel');
	}
	if (checkedArchived && room.archived) {
		throw new Meteor.Error('error-room-archived', `The channel, ${room.name}, is archived`);
	}

	return room;
}

API.v1.get(
	'rooms.nameExists',
	{
		authRequired: true,
		query: isGETRoomsNameExists,
		response: {
			200: ajv.compile<{ exists: boolean }>({
				type: 'object',
				properties: {
					exists: { type: 'boolean' },
					success: { type: 'boolean', enum: [true] },
				},
				required: ['exists', 'success'],

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Unarchive the room first (rooms.unarchive) if the operation should proceed.
  2. Pass checkedArchived=false where the calling endpoint exposes it, if archived rooms are legitimately in scope.
  3. Filter archived rooms out of automation targets beforehand.

Example fix

// before - default checkedArchived=true rejects archived room
const room = await findRoomByIdOrName({ params: { roomId } });

// after - allow archived rooms when the caller supports it
const room = await findRoomByIdOrName({ params: { roomId }, checkedArchived: false });
Defensive patterns

Strategy: validation

Validate before calling

// Skip or unarchive archived rooms before operating
const { room } = await fetch(`/api/v1/rooms.info?roomId=${encodeURIComponent(roomId)}`).then(r => r.json());
if (room?.archived) {
  await fetch('/api/v1/rooms.unarchive', { method:'POST', body: JSON.stringify({ roomId }) });
}
// proceed with the findRoomByIdOrName-backed call

Type guard

function isArchived(room: { archived?: boolean } | undefined): boolean {
  return !!room?.archived;
}

Try / catch

try {
  await callFindRoomByIdOrName({ params: { roomId } });
} catch (e) {
  if (e.error === 'error-room-archived') { /* unarchive or skip */ }
}

Prevention

When it happens

Trigger: Calling a findRoomByIdOrName-backed endpoint (with default checkedArchived=true) for a room that has been archived by an admin.

Common situations: Posting/operating on a channel after it was archived; automation targeting a room that got archived between scheduling and execution.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/46a7583bebb03d64. Report an issue: GitHub.