{"record":{"id":"e647e17740ad05a4","repo":"paperclipai/paperclip","slug":"cannot-load-plugin-in-status-plugin-status-p","errorCode":null,"errorMessage":"Cannot load plugin in status '${plugin.status}'. Plugin must be in 'installed' or 'ready' status.","messagePattern":"Cannot load plugin in status '(.+?)'\\. Plugin must be in 'installed' or 'ready' status\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-loader.ts","lineNumber":2038,"sourceCode":"\n      // If the plugin is in 'installed' status, transition it to 'ready' first.\n      // lifecycleManager.load() transitions the status AND activates the plugin\n      // via activateReadyPlugin() → loadSingle() (recursive call with 'ready'\n      // status) → activatePlugin(). We must NOT call activatePlugin() again here,\n      // as that would double-start the worker and duplicate registrations.\n      if (plugin.status === \"installed\") {\n        await runtimeServices.lifecycleManager.load(pluginId);\n        const updated = (await registry.getById(pluginId)) as PluginRecord | null;\n        if (!updated) throw new Error(`Plugin not found after status update: ${pluginId}`);\n        return {\n          plugin: updated,\n          success: true,\n          registered: { worker: true, eventSubscriptions: 0, jobs: 0, webhooks: 0, tools: 0 },\n        };\n      }\n\n      if (plugin.status !== \"ready\") {\n        throw new Error(\n          `Cannot load plugin in status '${plugin.status}'. ` +\n            `Plugin must be in 'installed' or 'ready' status.`,\n        );\n      }\n\n      return activatePlugin(plugin, {\n        markErrorOnFailure: options.markErrorOnFailure ?? true,\n      });\n    },\n\n    // -----------------------------------------------------------------------\n    // unloadSingle\n    // -----------------------------------------------------------------------\n\n    async unloadSingle(pluginId: string, pluginKey: string): Promise<void> {\n      if (!runtimeServices) {\n        throw new Error(\n          \"Cannot unloadSingle: no PluginRuntimeServices provided.\",","sourceCodeStart":2020,"sourceCodeEnd":2056,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-loader.ts#L2020-L2056","documentation":"State-machine guard in loadSingle: the plugin's status is neither installed nor ready, so it cannot be loaded (e.g. it is disabled, errored, or uninstalled). Callers must move the plugin into a loadable state first; the plugin's lifecycle status is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-loader.ts:2038 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Transition the plugin to 'installed' or 'ready' status before loading (complete install/build steps first)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}