RocketChat/Rocket.Chat · error · Error

Room converter not found

Error message

Room converter not found

What it means

Thrown by AppRoomBridge.getAllRooms when the orchestrator's converter registry does not contain a 'rooms' converter. Same class of infrastructure error as error 57: the converters were not registered during Apps Engine bootstrap, so convertRoomRaw cannot run. The guard prevents a null-deref further down the iteration.

Source

Thrown at apps/meteor/app/apps/server/bridges/rooms.ts:209

	protected async getAllRooms(filters: GetRoomsFilters = {}, options: GetRoomsOptions = {}, appId: string): Promise<Array<IRoomRaw>> {
		this.orch.debugLog(`The App ${appId} is getting all rooms with options`, options);

		const { limit = 100, skip = 0 } = options;

		const findOptions: FindOptions<ICoreRoom> = {
			sort: { ts: -1 },
			skip,
			limit: Math.min(limit, 100),
			projection: rawRoomProjection,
		};

		const { types, discussions, teams } = filters;

		const rooms: IRoomRaw[] = [];

		const roomConverter = this.orch.getConverters()?.get('rooms');
		if (!roomConverter) {
			throw new Error('Room converter not found');
		}

		for await (const room of Rooms.findAllByTypesAndDiscussionAndTeam({ types, discussions, teams }, findOptions)) {
			const converted = await roomConverter.convertRoomRaw(room);
			if (converted) {
				rooms.push(converted);
			}
		}

		return rooms;
	}

	protected async getDirectByUsernames(usernames: Array<string>, appId: string): Promise<IRoom | undefined> {
		this.orch.debugLog(`The App ${appId} is getting direct room by usernames: "${usernames}"`);
		const room = await Rooms.findDirectRoomContainingAllUsernames(usernames, {});
		if (!room) {
			return undefined;
		}

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Call getAllRooms only from runtime handlers that run after Apps Engine initialization completes.
  2. Verify converter availability before calling, and degrade gracefully (return empty / log).
  3. In tests, register a rooms converter on the orchestrator or mock getAllRooms at the accessor level.

Example fix

// before
const all = await rooms.getAllRooms(filters, opts, appId);

// after
if (!this.orch.getConverters()?.has('rooms')) {
  this.app.getLogger().warn('Rooms converter not ready');
  return [];
}
return await rooms.getAllRooms(filters, opts, appId);
Defensive patterns

Strategy: validation

Validate before calling

// Defer getAllRooms to runtime handlers after Apps Engine init.
// If you must call from an early hook, guard and degrade:
return await rooms.getAllRooms(filters, opts, appId);

Try / catch

try {
  return await rooms.getAllRooms(filters, opts, appId);
} catch (e) {
  if (e instanceof Error && /Room converter not found/.test(e.message)) {
    this.app.getLogger().warn('Rooms converter not ready');
    return [];
  }
  throw e;
}

Prevention

When it happens

Trigger: An App calls the rooms accessor's getAllRooms (the bulk room listing API) before the orchestrator finished initializing or after it was torn down. Also reproducible in unit tests that instantiate AppRoomBridge without registering converters.

Common situations: Calling getAllRooms from an early lifecycle hook; long-lived background task that runs after App disable; test setup missing the rooms converter; partial bootstrap after a failed install.

Related errors


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