{"record":{"id":"0d4f958dfa04a805","repo":"davila7/claude-code-templates","slug":"failed-to-load-marketplaces","errorCode":null,"errorMessage":"Failed to load marketplaces","messagePattern":"Failed to load marketplaces","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli-tool/src/plugin-dashboard.js","lineNumber":568,"sourceCode":"\n      next();\n    });\n\n    // Serve static files\n    this.app.use(express.static(path.join(__dirname, 'plugin-dashboard-web')));\n\n    // API endpoints - reload data on each request\n    this.app.get('/api/marketplaces', async (req, res) => {\n      try {\n        await this.loadPluginData();\n        res.json({\n          marketplaces: this.marketplaces || [],\n          count: (this.marketplaces || []).length,\n          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) => {","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/plugin-dashboard.js#L550-L586","documentation":"HTTP 500 from GET /api/marketplaces in the plugin dashboard when loading marketplace data throws inside loadPluginData/marketplace loading. The console line 'Error loading marketplaces:' on the server carries the underlying cause.","triggerScenarios":"GET /api/marketplaces when reading/parsing the plugins config (e.g. ~/.claude/plugins or the marketplaces cache) fails — malformed JSON, unreadable directory, or an unexpected entry shape while building this.marketplaces.","commonSituations":"Corrupted marketplace cache/JSON after an interrupted write; permissions changes on the config directory; a hand-edited or third-party marketplace entry with fields the loader doesn't expect; partial install/upgrade of the package.","solutions":["Check server console for 'Error loading marketplaces:' and the real error message","Validate/repair or delete the marketplace config/cache file so it regenerates (back it up first)","Verify read permissions on the plugins config directory","Reinstall or update the plugin-dashboard package if the loader is outdated for the current config format"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"try { const data = await getMarketplaces(); } catch (e) { showError(e.message); // fall back to empty list render renderMarketplaces([]); }","preventionTips":["Back up marketplace config before hand-editing","Watch server logs for 'Error loading marketplaces:' to catch corruption early","Validate config JSON after tooling writes it"],"tags":["http-500","express","marketplaces","config-parsing"],"backgroundTag":"internal-server-error","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}