{"record":{"id":"486080eab11636f3","repo":"davila7/claude-code-templates","slug":"failed-to-load-permissions","errorCode":null,"errorMessage":"Failed to load permissions","messagePattern":"Failed to load permissions","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli-tool/src/plugin-dashboard.js","lineNumber":601,"sourceCode":"      }\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);\n        res.status(500).json({ error: 'Failed to load permissions' });\n      }\n    });\n\n    this.app.get('/api/summary', async (req, res) => {\n      try {\n        await this.loadPluginData();\n        res.json({\n          marketplaces: (this.marketplaces || []).length,\n          plugins: (this.plugins || []).length,\n          permissions: {\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            total: (this.permissions?.agents || []).length +\n                   (this.permissions?.commands || []).length +\n                   (this.permissions?.hooks || []).length +\n                   (this.permissions?.mcps || []).length","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/plugin-dashboard.js#L583-L619","documentation":"HTTP 500 from GET /api/permissions in the plugin dashboard when building the permissions payload (tools, agents, mcps from this.permissions) fails during data loading. The catch-all responds after logging 'Error loading permissions:'.","triggerScenarios":"GET /api/permissions when loadPluginData() throws while reading the permissions/settings files that populate this.permissions, or when those files are malformed.","commonSituations":"Corrupted or hand-edited settings/permissions JSON; file locked or unreadable due to permissions; partial upgrade leaving a new-format permissions file the loader can't parse.","solutions":["Check the server console for 'Error loading permissions:' and the underlying message","JSON-validate the permissions/settings files the dashboard reads; restore from backup or regenerate","Fix filesystem read permissions on the config directory and restart the dashboard","Update the plugin-dashboard package to match the current permissions file format"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"null","typeGuard":null,"tryCatchPattern":"try { perms = await getPermissions(); } catch { perms = { tools: [], agents: [], mcps: [] }; }","preventionTips":["Treat config files as code: validate and back them up","Retry once after repairing the offending file","Watch dashboard console output for the wrapped root cause"],"tags":["http-500","express","permissions","config-parsing"],"backgroundTag":"internal-server-error","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}