davila7/claude-code-templates · error

Failed to load permissions

Error message

Failed to load permissions

What it means

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:'.

Source

Thrown at cli-tool/src/plugin-dashboard.js:601

      }
    });

    this.app.get('/api/permissions', async (req, res) => {
      try {
        await this.loadPluginData();
        res.json({
          permissions: this.permissions || {},
          counts: {
            agents: (this.permissions?.agents || []).length,
            commands: (this.permissions?.commands || []).length,
            hooks: (this.permissions?.hooks || []).length,
            mcps: (this.permissions?.mcps || []).length
          },
          timestamp: new Date().toISOString()
        });
      } catch (error) {
        console.error('Error loading permissions:', error);
        res.status(500).json({ error: 'Failed to load permissions' });
      }
    });

    this.app.get('/api/summary', async (req, res) => {
      try {
        await this.loadPluginData();
        res.json({
          marketplaces: (this.marketplaces || []).length,
          plugins: (this.plugins || []).length,
          permissions: {
            agents: (this.permissions?.agents || []).length,
            commands: (this.permissions?.commands || []).length,
            hooks: (this.permissions?.hooks || []).length,
            mcps: (this.permissions?.mcps || []).length,
            total: (this.permissions?.agents || []).length +
                   (this.permissions?.commands || []).length +
                   (this.permissions?.hooks || []).length +
                   (this.permissions?.mcps || []).length

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Check the server console for 'Error loading permissions:' and the underlying message
  2. JSON-validate the permissions/settings files the dashboard reads; restore from backup or regenerate
  3. Fix filesystem read permissions on the config directory and restart the dashboard
  4. Update the plugin-dashboard package to match the current permissions file format
Defensive patterns

Strategy: fallback

Validate before calling

null

Try / catch

try { perms = await getPermissions(); } catch { perms = { tools: [], agents: [], mcps: [] }; }

Prevention

When it happens

Trigger: GET /api/permissions when loadPluginData() throws while reading the permissions/settings files that populate this.permissions, or when those files are malformed.

Common situations: 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.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/486080eab11636f3. Report an issue: GitHub.