{"record":{"id":"99e895f9a7e11c81","repo":"santifer/career-ops","slug":"could-not-release-report-reservation-e-message","errorCode":null,"errorMessage":"Could not release report reservation: ${e.message}","messagePattern":"Could not release report reservation: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"openrouter-runner.mjs","lineNumber":742,"sourceCode":"    const tsvFile     = `batch/tracker-additions/or-${numStr}-${slug}.tsv`;\n    // Header row, then the single data row. merge-tracker.mjs resolves the\n    // fields by NAME when the header is present (#3517), so this row cannot be\n    // read into the wrong columns. (Headerless files still work; they are the\n    // legacy form, and they are the ones that can hit the undecidable\n    // score-vs-status case.)\n    writeFile(tsvFile, `${TSV_ADDITION_HEADER}\\n${tsvLine}`);\n\n    console.log(`\\n✅ Report saved: ${relPath}`);\n    console.log('\\n─── EVALUATION ──────────────────────────────────────\\n');\n    console.log(result);\n    console.log('\\n─────────────────────────────────────────────────────\\n');\n\n    return relPath;\n  } finally {\n    try {\n      await releaseReportNumbers(reservedNumbers, { reportsDir: path.join(__dirname, 'reports') });\n    } catch (e) {\n      console.warn(`Could not release report reservation: ${e.message}`);\n    }\n  }\n}\n\n// -- PIPELINE --\nasync function cmdPipeline(ctx) {\n  const pending = readPipeline();\n  if (pending.length === 0) {\n    console.log('No pending listings in pipeline.md.');\n    return;\n  }\n\n  console.log(`Processing ${pending.length} pending listing(s) from pipeline.md...\\n`);\n\n  for (let i = 0; i < pending.length; i++) {\n    const item = pending[i];\n    console.log(`\\n[${i + 1}/${pending.length}] ${item.company} — ${item.role}`);\n    try {","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/openrouter-runner.mjs#L724-L760","documentation":"After a pipeline run, the code releases the report-number range it reserved via reserve-report-num.mjs so stale reservations don't block future runs. If the release call itself fails, the run's result is still returned (the release is in a `finally`), and only this warning is printed — the reservation may remain until its 4-hour GC window expires.","triggerScenarios":"releaseReportNumbers(reservedNumbers, { reportsDir }) throwing: reports directory missing/unwritable, a filesystem error while scanning sentinel files, or a corrupted/locked sentinel in the reservation mechanism.","commonSituations":"Running the pipeline in a container where reports/ is read-only or was never created; concurrent workers racing on the same reservation files; deleting reports/ mid-run.","solutions":["Check that the `reports/` directory exists and is writable by the process running the script.","If the run itself succeeded, ignore the warning: stale sentinels are garbage-collected after 4h, or free the range manually with `node reserve-report-num.mjs --release <range>`.","Re-run the release manually if you need the numbers back immediately.","Look for concurrent pipelines sharing the same reportsDir and serialize them."],"exampleFix":"// before\n// warning appears; reservation leaks until GC\n// after (manual cleanup)\nnode reserve-report-num.mjs --release 042-049","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nconst dir = path.join(__dirname, 'reports');\nif (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });\nfs.accessSync(dir, fs.constants.W_OK);","typeGuard":null,"tryCatchPattern":"try {\n  await releaseReportNumbers(reservedNumbers, { reportsDir });\n} catch (e) {\n  console.warn(`Could not release report reservation: ${e.message}`);\n  // release manually within 4h: node reserve-report-num.mjs --release <range>\n}","preventionTips":["Ensure reports/ exists and is writable before reserving report numbers.","Release reservations promptly; don't rely on the 4h GC.","Avoid running concurrent pipelines against the same reportsDir."],"tags":["filesystem","cleanup","report-numbering","pipeline"],"backgroundTag":"file-write-failed","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}