{"record":{"id":"1a59ca862a08bb3a","repo":"paperclipai/paperclip","slug":"failed-to-activate-plugin-loadresult-plugin-plug","errorCode":null,"errorMessage":"Failed to activate plugin ${loadResult.plugin.pluginKey}","messagePattern":"Failed to activate plugin (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-lifecycle.ts","lineNumber":427,"sourceCode":"    } catch (err) {\n      log.warn(\n        { pluginId, pluginKey, err: err instanceof Error ? err.message : String(err) },\n        \"plugin lifecycle: failed to stop worker (best-effort)\",\n      );\n    }\n  }\n\n  async function activateReadyPlugin(pluginId: string): Promise<void> {\n    const supportsRuntimeActivation =\n      typeof pluginLoaderInstance.hasRuntimeServices === \"function\"\n      && typeof pluginLoaderInstance.loadSingle === \"function\";\n    if (!supportsRuntimeActivation || !pluginLoaderInstance.hasRuntimeServices()) {\n      return;\n    }\n\n    const loadResult = await pluginLoaderInstance.loadSingle(pluginId);\n    if (!loadResult.success) {\n      throw new Error(\n        loadResult.error\n        ?? `Failed to activate plugin ${loadResult.plugin.pluginKey}`,\n      );\n    }\n  }\n\n  async function deactivatePluginRuntime(\n    pluginId: string,\n    pluginKey: string,\n  ): Promise<void> {\n    const supportsRuntimeDeactivation =\n      typeof pluginLoaderInstance.hasRuntimeServices === \"function\"\n      && typeof pluginLoaderInstance.unloadSingle === \"function\";\n\n    if (supportsRuntimeDeactivation && pluginLoaderInstance.hasRuntimeServices()) {\n      await pluginLoaderInstance.unloadSingle(pluginId, pluginKey);\n      return;\n    }","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-lifecycle.ts#L409-L445","documentation":"Activation failure wrapper in activateReadyPlugin: loading the plugin's runtime bundle via pluginLoaderInstance.loadSingle failed (or returned no result), so the ready plugin could not be moved into active service. This is a contextual wrapper around a lower-level load error; the plugin's runtime bundle or its dependencies are at fault.","triggerScenarios":"Thrown at server/src/services/plugin-lifecycle.ts:427 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the plugin's activation error in server logs (worker start, manifest, or capability issues), fix the underlying cause, and retry activation."],"exampleFix":null,"handlingStrategy":"try-catch","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"}