{"record":{"id":"6083571e54bd21b2","repo":"ruvnet/ruflo","slug":"shutdown-failed","errorCode":"SHUTDOWN_FAILED","errorMessage":"Failed to shutdown plugin '${plugin.name}': ${error}","messagePattern":"Failed to shutdown plugin '(.+?)': (.+?)","errorType":"exception","errorClass":"PluginError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/shared/src/plugin-loader.ts","lineNumber":364,"sourceCode":"  }\n\n  /**\n   * Shutdown a single plugin\n   */\n  private async shutdownPlugin(plugin: ClaudeFlowPlugin): Promise<void> {\n    this.registry.updatePluginState(plugin.name, 'shutting-down');\n\n    try {\n      await this.withTimeout(\n        plugin.shutdown(),\n        this.config.shutdownTimeout,\n        `Plugin '${plugin.name}' shutdown timed out`\n      );\n\n      this.registry.updatePluginState(plugin.name, 'shutdown');\n    } catch (error) {\n      this.registry.updatePluginState(plugin.name, 'error', error instanceof Error ? error : new Error(String(error)));\n      throw new PluginError(\n        `Failed to shutdown plugin '${plugin.name}': ${error}`,\n        plugin.name,\n        'SHUTDOWN_FAILED',\n        error instanceof Error ? error : undefined\n      );\n    }\n  }\n\n  /**\n   * Initialize plugins sequentially\n   */\n  private async initializePluginsSequential(\n    plugins: ClaudeFlowPlugin[],\n    context: PluginContext,\n    results: LoadPluginsResult\n  ): Promise<void> {\n    for (const plugin of plugins) {\n      try {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/shared/src/plugin-loader.ts#L346-L382","documentation":"PluginLoader.shutdownPlugin caught a failure (or timeout) from the plugin's own shutdown() hook, marked the plugin 'error', and rethrew as PluginError. The plugin's teardown logic failed during unload; the loader names the plugin and preserves the underlying error.","triggerScenarios":"Thrown at v3/@claude-flow/shared/src/plugin-loader.ts:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error from the plugin's shutdown hook and fix the resource cleanup.","Ensure shutdown is idempotent so repeated calls do not fail."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}