{"record":{"id":"0d7ee088e2c7ccfb","repo":"davila7/claude-code-templates","slug":"failed-to-load-plugins","errorCode":null,"errorMessage":"Failed to load plugins","messagePattern":"Failed to load plugins","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli-tool/src/plugin-dashboard.js","lineNumber":582,"sourceCode":"          timestamp: new Date().toISOString()\n        });\n      } catch (error) {\n        console.error('Error loading marketplaces:', error);\n        res.status(500).json({ error: 'Failed to load marketplaces' });\n      }\n    });\n\n    this.app.get('/api/plugins', async (req, res) => {\n      try {\n        await this.loadPluginData();\n        res.json({\n          plugins: this.plugins || [],\n          count: (this.plugins || []).length,\n          timestamp: new Date().toISOString()\n        });\n      } catch (error) {\n        console.error('Error loading plugins:', error);\n        res.status(500).json({ error: 'Failed to load plugins' });\n      }\n    });\n\n    this.app.get('/api/permissions', async (req, res) => {\n      try {\n        await this.loadPluginData();\n        res.json({\n          permissions: this.permissions || {},\n          counts: {\n            agents: (this.permissions?.agents || []).length,\n            commands: (this.permissions?.commands || []).length,\n            hooks: (this.permissions?.hooks || []).length,\n            mcps: (this.permissions?.mcps || []).length\n          },\n          timestamp: new Date().toISOString()\n        });\n      } catch (error) {\n        console.error('Error loading permissions:', error);","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/plugin-dashboard.js#L564-L600","documentation":"HTTP 500 from GET /api/plugins in the plugin dashboard when the plugin data loader throws. this.plugins is populated by loadPluginData(); any failure while scanning/parsing installed plugin definitions surfaces here.","triggerScenarios":"GET /api/plugins when scanning installed plugin files fails — malformed plugin JSON/frontmatter, missing directory that's still referenced in config, or filesystem errors during the scan.","commonSituations":"A partially-installed plugin directory; plugin metadata edited by hand with syntax errors; plugins directory moved or deleted while the dashboard runs; OS-level permission changes.","solutions":["Read the server console 'Error loading plugins:' line for the root cause","Remove or fix the offending plugin definition (JSON parse-check each file under the plugins directory)","Restore/repair the plugins directory the loader scans, then restart the dashboard","Update the package if a newer plugin format isn't understood by this loader"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"null","typeGuard":null,"tryCatchPattern":"try { plugins = await getPlugins(); } catch { plugins = []; /* keep UI usable, surface banner */ }","preventionTips":["Keep plugin definitions machine-generated where possible","Avoid deleting/moving plugin directories while the dashboard runs","JSON-lint edited plugin files"],"tags":["http-500","express","plugins","config-parsing"],"backgroundTag":"internal-server-error","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}