{"record":{"id":"abd02461a21956c0","repo":"RocketChat/Rocket.Chat","slug":"apps-engine-not-loaded-abd024","errorCode":null,"errorMessage":"apps-engine-not-loaded","messagePattern":"apps-engine-not-loaded","errorType":"exception","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/services/video-conference/service.ts","lineNumber":902,"sourceCode":"\t\t\tcallId,\n\t\t};\n\t}\n\n\tprivate async joinCall(\n\t\tcall: ExternalVideoConference,\n\t\tuser: AtLeast<IUser, '_id' | 'username' | 'name' | 'avatarETag'> | undefined,\n\t\toptions: VideoConferenceJoinOptions,\n\t): Promise<string> {\n\t\tvoid callbacks.runAsync('onJoinVideoConference', call._id, user?._id);\n\n\t\tawait this.runOnUserJoinEvent(call._id, user as IVideoConferenceUser);\n\n\t\treturn this.getUrl(call, user, options);\n\t}\n\n\tprivate async getProviderManager(): Promise<AppVideoConfProviderManager> {\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()?.getVideoConfProviderManager();\n\t\tif (!manager) {\n\t\t\tthrow new Error(availabilityErrors.NO_APP);\n\t\t}\n\n\t\treturn manager;\n\t}\n\n\tprivate async getRoomName(rid: string): Promise<string> {\n\t\tconst room = await Rooms.findOneById<Pick<IRoom, '_id' | 'name' | 'fname'>>(rid, { projection: { name: 1, fname: 1 } });\n\n\t\treturn room?.fname || room?.name || rid;\n\t}\n\n\tprivate async generateNewUrl(call: ExternalVideoConference): Promise<string> {\n\t\tif (!videoConfProviders.isProviderAvailable(call.providerName)) {","sourceCodeStart":884,"sourceCodeEnd":920,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/services/video-conference/service.ts#L884-L920","documentation":"Thrown by getProviderManager(), the gateway for every provider-manager operation (URL generation, join callbacks, provider events): Apps.self?.isLoaded() is false, so the Apps-Engine subsystem is not (yet) loaded. The engine loads asynchronously during server startup and can also be absent if apps subsystem initialization failed, so any video-conf provider call racing the boot sequence hits this.","triggerScenarios":"Issuing video conference start/join/provider-manager requests while the server is still bootstrapping (engine still loading apps); after a restart where the Apps-Engine failed to initialize; automated health-check or integration scripts that fire the moment the HTTP port opens.","commonSituations":"CI/e2e suites and bots that start calling APIs as soon as the port accepts connections; startup-order dependencies in custom services that assume video conf is ready; a crashed apps-engine leaving isLoaded() false.","solutions":["Wait for the server to fully finish startup (apps loaded; admin UI shows apps ready) before issuing video conference requests","Check Administration > Apps and server logs to confirm the Apps-Engine initialized without errors","Restart the server if the engine failed to load","For automation, add a readiness probe that retries until video conf provider operations succeed"],"exampleFix":"// before\nawait videoConfService.startCall(uid, rid); // during boot -> Error('apps-engine-not-loaded')\n\n// after\nif (!Apps.self?.isLoaded()) {\n\tawait waitForAppsEngineLoaded(); // poll isLoaded() with backoff\n}\nawait videoConfService.startCall(uid, rid);","handlingStrategy":"retry","validationCode":"import { Apps } from '.../apps/server';\n\nif (!Apps.self?.isLoaded()) {\n\tawait new Promise((resolve) => setTimeout(resolve, 1000)); // or subscribe to an apps-loaded event\n}\nconst url = await videoConfService.joinCall(call, user, options);","typeGuard":null,"tryCatchPattern":"for (let attempt = 0; attempt < 5; attempt++) {\n\ttry { return await videoConfService.joinCall(call, user, options); }\n\tcatch (err) {\n\t\tif (!(err instanceof Error && err.message === 'apps-engine-not-loaded')) throw err;\n\t\tawait backoff(attempt); // engine still booting\n\t}\n}","preventionTips":["Gate video-conf automation on apps-engine readiness, not HTTP port availability","Add readiness probes that exercise a provider-manager operation","Watch startup logs for apps-engine initialization failures"],"tags":["video-conference","apps-engine","startup","initialization","timing"],"backgroundTag":"dependency-not-initialized","analyzedSha":"e4b8178b205510181a96ceefee043d0abcd13e5a","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}