{"record":{"id":"e79abd67c509d669","repo":"santifer/career-ops","slug":"could-not-save-report-err-message-e79abd","errorCode":null,"errorMessage":"⚠️   Could not save report: ${err.message}","messagePattern":"⚠️   Could not save report: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ollama-eval.mjs","lineNumber":394,"sourceCode":"**Date:** ${today}\n**Archetype:** ${archetype}\n**Score:** ${score}/5\n**Legitimacy:** ${legitimacy}\n**PDF:** pending\n**Tool:** Ollama (${modelName})\n\n---\n\n${evaluationText.replace(/---SCORE_SUMMARY---[\\s\\S]*?---END_SUMMARY---/, '').trim()}\n`;\n\n    writeFileSync(reportPath, reportContent, 'utf-8');\n    console.log(`\\n✅  Report saved: reports/${filename}`);\n\n    console.log(`\\n📊  Tracker entry (add to data/applications.md):`);\n    console.log(`    | ${num} | ${today} | ${company} | ${role} | ${score}/5 | Evaluated | ❌ | [${num}](reports/${filename}) |`);\n  } catch (err) {\n    console.warn(`⚠️   Could not save report: ${err.message}`);\n  } finally {\n    if (reservedNumbers.length > 0) {\n      try {\n        await releaseReportNumbers(reservedNumbers, { reportsDir: PATHS.reports });\n      } catch (err) {\n        console.warn(`⚠️   Could not release report reservation: ${err.message}`);\n      }\n    }\n  }\n}\n\nconsole.log('\\n' + '─'.repeat(66));\nconsole.log(`  Score: ${score}/5  |  Archetype: ${archetype}  |  Legitimacy: ${legitimacy}`);\nconsole.log('─'.repeat(66) + '\\n');\n\nconsole.log(formatBreakdown(tracker, modelName, 'ollama'));\n","sourceCodeStart":376,"sourceCodeEnd":411,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/ollama-eval.mjs#L376-L411","documentation":"The report-saving try in ollama-eval.mjs failed, so the completed Ollama evaluation exists only on stdout — no numbered file was written under reports/. The try covers mkdirSync of reports/, reserveReportNumbers(1), and writeFileSync, so the throw can come from the filesystem (EACCES, ENOSPC, EISDIR) or from the reservation allocator itself. The finally still releases any reserved numbers, so report numbering stays consistent.","triggerScenarios":"reports/ exists but is not writable by the current user (EACCES); disk full after a long local-model session (ENOSPC); a directory occupies the target filename (EISDIR); reserveReportNumbers throws on sentinel/lock contention with parallel workers — all surface as this same warning.","commonSituations":"Running as a different user or via cron than the one owning reports/; CI disk quotas; parallel evaluation workers colliding on reservation sentinels; read-only checkouts.","solutions":["Copy the report text from the terminal output above the warning into reports/{num}-{slug}-{date}.md manually — nothing else preserved it.","Check the basics: ls -ld reports (writable?), df -h (space?), and that no directory shares the target filename.","If parallel workers were running, re-run after they finish — reservation contention is transient.","Re-run the evaluation once the filesystem issue is fixed (local Ollama makes retries cheap)."],"exampleFix":"// before\nwriteFileSync(reportPath, reportContent, 'utf-8');\n// after — surface the offending path and code so the loss is diagnosable\ntry {\n  writeFileSync(reportPath, reportContent, 'utf-8');\n} catch (err) {\n  console.error(`Report write failed at ${reportPath}: ${err.code} — copy the evaluation above into this file manually.`);\n  throw err;\n}","handlingStrategy":"validation","validationCode":"import { accessSync, constants } from 'node:fs';\naccessSync('reports', constants.W_OK); // throws EACCES BEFORE the model call, not after","typeGuard":null,"tryCatchPattern":"try {\n  writeFileSync(reportPath, reportContent, 'utf-8');\n} catch (err) {\n  console.warn(`Could not save report (${err.code}): ${err.message}`);\n  // salvage: the full evaluation text is on stdout — tee it to a file\n} finally {\n  await releaseReportNumbers(reservedNumbers, { reportsDir }); // always run\n}","preventionTips":["Pre-flight that reports/ is writable before starting an expensive model run","Keep disk headroom on machines running local models — multi-GB models fill disks","Tee evaluation stdout to a log file so the report text is recoverable when the write fails"],"tags":["fs","report-persistence","disk-full","permissions","ollama"],"backgroundTag":"file-write-permission-denied","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}