{"record":{"id":"42f5fd5a43dd7097","repo":"RocketChat/Rocket.Chat","slug":"room-converter-not-found","errorCode":null,"errorMessage":"Room converter not found","messagePattern":"Room converter not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/rooms.ts","lineNumber":209,"sourceCode":"\tprotected async getAllRooms(filters: GetRoomsFilters = {}, options: GetRoomsOptions = {}, appId: string): Promise<Array<IRoomRaw>> {\n\t\tthis.orch.debugLog(`The App ${appId} is getting all rooms with options`, options);\n\n\t\tconst { limit = 100, skip = 0 } = options;\n\n\t\tconst findOptions: FindOptions<ICoreRoom> = {\n\t\t\tsort: { ts: -1 },\n\t\t\tskip,\n\t\t\tlimit: Math.min(limit, 100),\n\t\t\tprojection: rawRoomProjection,\n\t\t};\n\n\t\tconst { types, discussions, teams } = filters;\n\n\t\tconst rooms: IRoomRaw[] = [];\n\n\t\tconst roomConverter = this.orch.getConverters()?.get('rooms');\n\t\tif (!roomConverter) {\n\t\t\tthrow new Error('Room converter not found');\n\t\t}\n\n\t\tfor await (const room of Rooms.findAllByTypesAndDiscussionAndTeam({ types, discussions, teams }, findOptions)) {\n\t\t\tconst converted = await roomConverter.convertRoomRaw(room);\n\t\t\tif (converted) {\n\t\t\t\trooms.push(converted);\n\t\t\t}\n\t\t}\n\n\t\treturn rooms;\n\t}\n\n\tprotected async getDirectByUsernames(usernames: Array<string>, appId: string): Promise<IRoom | undefined> {\n\t\tthis.orch.debugLog(`The App ${appId} is getting direct room by usernames: \"${usernames}\"`);\n\t\tconst room = await Rooms.findDirectRoomContainingAllUsernames(usernames, {});\n\t\tif (!room) {\n\t\t\treturn undefined;\n\t\t}","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/app/apps/server/bridges/rooms.ts#L191-L227","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Call getAllRooms only from runtime handlers that run after Apps Engine initialization completes.","Verify converter availability before calling, and degrade gracefully (return empty / log).","In tests, register a rooms converter on the orchestrator or mock getAllRooms at the accessor level."],"exampleFix":"// before\nconst all = await rooms.getAllRooms(filters, opts, appId);\n\n// after\nif (!this.orch.getConverters()?.has('rooms')) {\n  this.app.getLogger().warn('Rooms converter not ready');\n  return [];\n}\nreturn await rooms.getAllRooms(filters, opts, appId);","handlingStrategy":"validation","validationCode":"// Defer getAllRooms to runtime handlers after Apps Engine init.\n// If you must call from an early hook, guard and degrade:\nreturn await rooms.getAllRooms(filters, opts, appId);","typeGuard":null,"tryCatchPattern":"try {\n  return await rooms.getAllRooms(filters, opts, appId);\n} catch (e) {\n  if (e instanceof Error && /Room converter not found/.test(e.message)) {\n    this.app.getLogger().warn('Rooms converter not ready');\n    return [];\n  }\n  throw e;\n}","preventionTips":["Call getAllRooms only from post-init handlers.","Guard with a try/catch that degrades to an empty list during startup races.","In tests, register a rooms converter or mock at the accessor boundary."],"tags":["apps-engine","room-bridge","orchestrator","converter","initialization","internal-state"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}