{"record":{"id":"058bf3fcc1fb9197","repo":"RocketChat/Rocket.Chat","slug":"could-not-get-the-message-converter-to-process-liv","errorCode":null,"errorMessage":"Could not get the message converter to process livechat room messages","messagePattern":"Could not get the message converter to process livechat room messages","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"apps/meteor/app/apps/server/bridges/livechat.ts","lineNumber":401,"sourceCode":"\t\t\t.convertDepartment(await LivechatDepartment.findOneByIdOrName(value, {}));\n\t}\n\n\tprotected async findDepartmentsEnabledWithAgents(appId: string): Promise<Array<IDepartment>> {\n\t\tthis.orch.debugLog(`The App ${appId} is looking for livechat departments.`);\n\n\t\tconst converter = this.orch.getConverters()?.get('departments');\n\t\t// #TODO: #AppsEngineTypes - Remove explicit types and typecasts once the apps-engine definition/implementation mismatch is fixed.\n\t\tconst boundConverter = converter.convertDepartment.bind(converter) as (_: ILivechatDepartment) => Promise<IDepartment>;\n\n\t\treturn Promise.all((await LivechatDepartment.findEnabledWithAgents().toArray()).map(boundConverter));\n\t}\n\n\tprotected async _fetchLivechatRoomMessages(appId: string, roomId: string): Promise<Array<IAppsEngineMessage>> {\n\t\tthis.orch.debugLog(`The App ${appId} is getting the transcript for livechat room ${roomId}.`);\n\t\tconst messageConverter = this.orch.getConverters()?.get('messages');\n\n\t\tif (!messageConverter) {\n\t\t\tthrow new Error('Could not get the message converter to process livechat room messages');\n\t\t}\n\n\t\tconst livechatMessages = await getRoomMessages({ rid: roomId });\n\t\treturn Promise.all(await livechatMessages.map((message) => messageConverter.convertMessage(message, livechatMessages)).toArray());\n\t}\n\n\tprotected async setCustomFields(\n\t\tdata: { token: IVisitor['token']; key: string; value: string; overwrite: boolean },\n\t\tappId: string,\n\t): Promise<number> {\n\t\tthis.orch.debugLog(`The App ${appId} is setting livechat visitor's custom fields.`);\n\n\t\treturn setCustomFields(data);\n\t}\n}\n","sourceCodeStart":383,"sourceCodeEnd":417,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/app/apps/server/bridges/livechat.ts#L383-L417","documentation":"Thrown by AppLivechatBridge._fetchLivechatRoomMessages when this.orch.getConverters()?.get('messages') returns undefined. The message converter is a core dependency of the orchestrator; its absence means the orchestrator was not initialized correctly, so the transcript fetch cannot map persisted messages to apps-engine objects.","triggerScenarios":"An App requests a livechat room transcript (e.g. app.getLivechatRead().getMessages(roomId)); the orchestrator's converter registry does not contain a 'messages' converter, returning undefined.","commonSituations":"Orchestrator initialization order changed and converters were not registered before the App call; a custom/forked build omitted the message converter; a partial apps-engine upgrade where the converter key was renamed; the App invoked the accessor before server startup finished initializing the orchestrator.","solutions":["Confirm the orchestrator completed initialization (all converters registered) before Apps are allowed to run.","Verify the apps-engine bridge/converter wiring is intact in the current build (no missing import/registration).","Reinstall/restart the server so the orchestrator re-registers converters on boot.","If forking, ensure the 'messages' converter is added to the orchestrator's converter map."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const messageConverter = this.orch.getConverters()?.get('messages');\nif (!messageConverter) {\n  throw new Error('Orchestrator not initialized: message converter missing. Restart/reinstall the server.');\n}\nreturn messageConverter;","typeGuard":"const hasMessageConverter = (orch: IAppServerOrchestrator): boolean =>\n  Boolean(orch.getConverters()?.get('messages'));","tryCatchPattern":"try {\n  return await app.getLivechatRead().getMessages(roomId);\n} catch (e) {\n  if ((e as Error).message.includes('message converter')) {\n    // surface as a server misconfiguration; do not retry until restart\n  }\n  throw e;\n}","preventionTips":["Ensure the orchestrator finishes initialization before Apps can invoke accessors.","Keep the apps-engine bridge and converter wiring intact across builds.","Restart the server if converters are missing after an upgrade."],"tags":["apps-engine","livechat","orchestrator","converter","initialization"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}