{"record":{"id":"d92b24c17e78f96f","repo":"RocketChat/Rocket.Chat","slug":"apps-engine-not-configured-correctly","errorCode":null,"errorMessage":"apps-engine-not-configured-correctly","messagePattern":"apps-engine-not-configured-correctly","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/api/v1/omnichannel/lib/outbound.ts","lineNumber":53,"sourceCode":"\t}\n\n\tpublic getProviderMetadata(providerId: string): Promise<IOutboundProviderMetadata> {\n\t\tconst provider = this.provider.findOneByProviderId(providerId);\n\t\tif (!provider) {\n\t\t\tthrow new Error('error-invalid-provider');\n\t\t}\n\n\t\treturn this.getProviderManager().getProviderMetadata(provider.appId, provider.type);\n\t}\n\n\tprivate getProviderManager() {\n\t\tif (!Apps.self?.isLoaded()) {\n\t\t\tthrow new Error('apps-engine-not-loaded');\n\t\t}\n\n\t\tconst manager = Apps.self?.getManager()?.getOutboundCommunicationProviderManager();\n\t\tif (!manager) {\n\t\t\tthrow new Error('apps-engine-not-configured-correctly');\n\t\t}\n\n\t\treturn manager;\n\t}\n\n\tpublic sendMessage(providerId: string, message: IOutboundMessage) {\n\t\tconst provider = this.provider.findOneByProviderId(providerId);\n\t\tif (!provider) {\n\t\t\tthrow new Error('error-invalid-provider');\n\t\t}\n\n\t\treturn this.getProviderManager().sendOutboundMessage(provider.appId, provider.type, message);\n\t}\n}\n\nexport const outboundMessageProvider = new OutboundMessageProviderService();\n\ngetOutboundService.patch(() => {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/api/v1/omnichannel/lib/outbound.ts#L35-L71","documentation":"Thrown by OutboundMessageProviderService.getProviderManager when the Apps Engine is loaded but Apps.self?.getManager()?.getOutboundCommunicationProviderManager() returns null/undefined. This indicates the Apps Engine is up but the outbound communication provider manager is not registered/initialized, i.e. a misconfiguration or an Apps Engine version that lacks the outbound manager. Plain Error, code 'apps-engine-not-configured-correctly'.","triggerScenarios":"Apps.self.isLoaded() is true, but getOutboundCommunicationProviderManager() returns nothing. Happens with an Apps Engine build that does not include the outbound provider manager, or when the manager failed to register during init.","commonSituations":"Apps Engine version mismatch (older engine without outbound support); partial apps-engine migration (see docs/apps-engine-migration.md); a custom apps-engine build that omits the outbound module; manager registration race.","solutions":["Upgrade the Apps Engine to a version that registers the OutboundCommunicationProviderManager.","Confirm the apps-engine migration step for outbound providers is complete.","Restart the server after apps-engine updates so the manager registers cleanly.","Check Apps Engine logs for manager registration errors and resolve them."],"exampleFix":"// before: assume manager exists\nsvc.getProviderMetadata(id);\n\n// after: probe and report configuration clearly\nconst manager = Apps.self?.getManager()?.getOutboundCommunicationProviderManager();\nif (!manager) {\n  throw new ConfigError('Outbound manager unavailable; upgrade/restart the Apps Engine.');\n}\nsvc.getProviderMetadata(id);","handlingStrategy":"validation","validationCode":"// Confirm the outbound manager is registered before calling\nimport { Apps } from '@rocket.chat/apps';\nfunction outboundManagerAvailable(): boolean {\n  return !!Apps.self?.isLoaded() && !!Apps.self?.getManager()?.getOutboundCommunicationProviderManager();\n}\nif (!outboundManagerAvailable()) {\n  throw new ConfigError('Outbound manager unavailable; upgrade or restart the Apps Engine.');\n}\nawait svc.getProviderMetadata(providerId);","typeGuard":"function hasOutboundManager(apps: typeof Apps): boolean {\n  return !!apps.self?.getManager()?.getOutboundCommunicationProviderManager();\n}","tryCatchPattern":"try {\n  return await svc.getProviderMetadata(providerId);\n} catch (e) {\n  if (e.message === 'apps-engine-not-configured-correctly') {\n    // surface a config error to ops rather than crashing the flow\n    reportAppsEngineMisconfiguration();\n    return null;\n  }\n  throw e;\n}","preventionTips":["After Apps Engine upgrades, restart the server so the outbound manager registers.","Complete the apps-engine migration steps for outbound providers before enabling the feature."],"tags":["apps-engine","outbound","configuration","lifecycle"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}