{"record":{"id":"3bc9cac40b791bd3","repo":"davila7/claude-code-templates","slug":"failed-to-generate-year-in-review","errorCode":null,"errorMessage":"Failed to generate year in review","messagePattern":"Failed to generate year in review","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli-tool/src/analytics.js","lineNumber":1254,"sourceCode":"    this.app.get('/api/2025', async (req, res) => {\n      try {\n        console.log('📅 Generating 2025 Year in Review...');\n\n        // Load all conversations for analysis\n        const allConversations = await this.conversationAnalyzer.loadConversations(this.stateCalculator);\n\n        // Generate year in review statistics\n        const yearInReview = await this.yearInReview2025.generateYearInReview(allConversations, this.claudeDir);\n\n        console.log(`✅ 2025 Year in Review generated with ${yearInReview.totalConversations} conversations`);\n\n        res.json({\n          ...yearInReview,\n          timestamp: new Date().toISOString()\n        });\n      } catch (error) {\n        console.error('Error generating 2025 year in review:', error);\n        res.status(500).json({\n          error: 'Failed to generate year in review',\n          message: error.message\n        });\n      }\n    });\n\n    // Year in Review 2025 page route\n    this.app.get('/2025', (req, res) => {\n      res.sendFile(path.join(__dirname, 'analytics-web', '2025.html'));\n    });\n\n    // Main dashboard route\n    this.app.get('/', (req, res) => {\n      res.sendFile(path.join(__dirname, 'analytics-web', 'index.html'));\n    });\n  }\n\n  async startServer() {","sourceCodeStart":1236,"sourceCodeEnd":1272,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/analytics.js#L1236-L1272","documentation":"500 from GET /api/2025 (Year in Review). The handler generates the yearly summary; unlike its siblings it includes error.message, so the response tells you the actual generation failure (usually reading/aggregating a year of conversation data).","triggerScenarios":"GET /api/2025 when the year-review generator throws — corrupt session files, missing timestamps in conversations, or resource exhaustion over a year of data.","commonSituations":"Very large conversation histories; sessions with malformed created_at fields; disk/read errors in ~/.claude/projects.","solutions":["Read the 'message' field of the 500 response — it carries error.message","Clear caches and retry the endpoint","Prune or archive very old/corrupt conversation files under ~/.claude/projects","If it consistently fails on one file, the message usually names it; remove/fix that file"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const hasData = await fetch(base + '/api/conversations').then(r => r.ok);","typeGuard":null,"tryCatchPattern":"try { return await getYearInReview(); } catch (e) { if (e.message) log(e.message); return generateClientSideFallbackSummary(); }","preventionTips":["Archive very large histories before running year-in-review","Check the message field first — it names the failing file"],"tags":["analytics","express","http-500","year-in-review"],"backgroundTag":"data-aggregation-failure","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}