RocketChat/Rocket.Chat · error · Meteor.Error

error-room-not-found

error-room-not-found

Error message

The required "roomId" or "roomName" param provided does not match any group

What it means

Thrown by getRoomFromParams when the looked-up room does not exist OR exists but its type is not 'p' (private group). Because the helper is used only by groups.* endpoints, passing a channel ('c'), direct message ('d'), or team-public room triggers it EVEN THOUGH the room exists. So 'not found' effectively means 'not a private group'.

Source

Thrown at apps/meteor/server/api/v1/groups.ts:99

			name: 1,
			fname: 1,
			prid: 1,
			archived: 1,
			broadcast: 1,
		},
	};

	const room = await (() => {
		if ('roomId' in params) {
			return Rooms.findOneById(params.roomId || '', roomOptions);
		}
		if ('roomName' in params) {
			return Rooms.findOneByName(params.roomName || '', roomOptions);
		}
	})();

	if (room?.t !== 'p') {
		throw new Meteor.Error('error-room-not-found', 'The required "roomId" or "roomName" param provided does not match any group');
	}

	return room;
}

// Returns the private group subscription IF found otherwise it will return the failure of why it didn't. Check the `statusCode` property
async function findPrivateGroupByIdOrName({
	params,
	checkedArchived = true,
	userId,
}: {
	params:
		| {
				roomId?: string;
		  }
		| {
				roomName?: string;
		  };

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Use the channels.* endpoints for type 'c' rooms and the im.* endpoints for DMs.
  2. Confirm the target room is actually a private group before calling groups.*.
  3. Verify the id/name spelling and that the room still exists.

Example fix

// before
const url = `/api/v1/groups.info?roomName=${name}`; // name may be a channel
// after
// look up the room first or branch on its type
const endpoint = room.t === 'c' ? 'channels.info' : room.t === 'p' ? 'groups.info' : 'im.info';
const url = `/api/v1/${endpoint}?roomId=${encodeURIComponent(room._id)}`;
Defensive patterns

Strategy: type-guard

Validate before calling

// route to the correct endpoint family based on room type
function endpointFor(room) {
  switch (room.t) {
    case 'p': return 'groups';
    case 'c': return 'channels';
    case 'd': return 'im';
    default: throw new Error('unsupported room type');
  }
}

Type guard

function isPrivateGroup(room): room is { _id: string; t: 'p' } {
  return !!room && room.t === 'p';
}

Try / catch

try { await groupsInfo({ roomId }); }
catch (e) {
  if (isApiError(e, 'error-room-not-found')) { /* maybe a channel: retry via channels.info, else show not-found */) }
  else throw e;
}

Prevention

When it happens

Trigger: Passing a channel id/name to groups.info; passing a DM id; roomName of a public room; a non-existent id; a room whose type was changed away from 'p'.

Common situations: Using the groups.* endpoint for a channel (should use channels.*); typo in the identifier; room converted from private to public.

Related errors


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