santifer/career-ops · error

⚠️ Report saved, but could not merge tracker addition…

Error message

⚠️   Report saved, but could not merge tracker addition into data/applications.md: ${err.message}

What it means

After the report and TSV addition are saved successfully, gemini-eval.mjs spawns merge-tracker.mjs via execFileSync with a 30s timeout to merge the tracker addition into data/applications.md. If the merge subprocess fails — non-zero exit, timeout, node not spawning — this warning is printed, exitCode becomes 1, and the tracker row stays unmerged. The report and the TSV file in batch/tracker-additions/ are intact, so the merge can be retried manually without re-evaluating.

Solutions

  1. Read merge-tracker.mjs's own error output (rerun manually: node merge-tracker.mjs) — it prints why the addition was skipped (duplicate, bad header, lock).
  2. If it was a duplicate, that's often correct: update the existing tracker row instead (node set-status.mjs) rather than adding a new one.
  3. If it was a lock, remove the stale lock or wait for the concurrent run to finish, then re-run node merge-tracker.mjs to pick up the pending TSV.
  4. If it was a timeout, rerun the merge manually — the addition TSV is already on disk in batch/tracker-additions/.

Example fix

// manual recovery — the TSV is already saved
// before (re-running the whole evaluation)
node gemini-eval.mjs ...
// after (merge only)
node merge-tracker.mjs
# or, if duplicate:
node set-status.mjs <report#|company> <State> --note "updated existing row"
Defensive patterns

Strategy: retry

Validate before calling

// before relying on auto-merge, check the pending addition is well-formed and not a duplicate
node check-table-freshness.mjs --summary   # tracker sanity
grep -i "<company>" data/applications.md     # existing row?
head -2 batch/tracker-additions/<file>.tsv   # header row present?

Try / catch

try {
  execFileSync(process.execPath, [mergeTracker], { stdio: 'pipe', timeout: 30000 });
} catch (err) {
  if (err.killed) console.warn('merge timed out — rerun: node merge-tracker.mjs');
  else console.warn(`merge failed (exit ${err.status}): ${err.stderr?.toString()}`);
  // the TSV in batch/tracker-additions/ is intact; merging can be retried safely
}

Prevention

When it happens

Trigger: execFileSync(process.execPath, [merge-tracker.mjs]) throwing: merge-tracker.mjs exits non-zero (duplicate row detection, malformed TSV header, locked tracker file), the 30s timeout elapses on a slow disk/large tracker, or spawn fails (EMFILE, missing node binary at process.execPath).

Common situations: A tracker addition whose company+role already exists and is judged a duplicate by merge-tracker.mjs; a stale lock file left by a crashed earlier merge; malformed header in the generated TSV (missing required labels); running many parallel evaluations causing lock contention or the 30s timeout to fire.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/4d05ed7689a92f70. Report an issue: GitHub.

Appendix: source

Thrown at gemini-eval.mjs:600

      console.log(`📊  Tracker addition saved: batch/tracker-additions/${num}-${companySlug}.tsv`);
      reportSaved = true;
    } catch (err) {
      console.warn(`⚠️   Could not save report: ${err.message}`);
      process.exitCode = 1;
    }

    if (reportSaved) {
      try {
        const mergeOutput = execFileSync(process.execPath, [join(CODE_ROOT, 'merge-tracker.mjs')], {
          cwd: CODE_ROOT,
          encoding: 'utf-8',
          stdio: ['ignore', 'pipe', 'pipe'],
          timeout: 30000,
        });
        if (mergeOutput.trim()) console.log(mergeOutput.trim());
        console.log('📊  Tracker merged into data/applications.md.');
      } catch (err) {
        console.warn(`⚠️   Report saved, but could not merge tracker addition into data/applications.md: ${err.message}`);
        process.exitCode = 1;
      }
    }
  } finally {
    if (reservedNumbers.length > 0) {
      try {
        await releaseReportNumbers(reservedNumbers, { rootDir: DATA_ROOT, reportsDir: PATHS.reports });
      } catch (err) {
        console.warn(`⚠️   Could not release report reservation: ${err.message}`);
      }
    }
  }
}

console.log('\n' + '─'.repeat(66));
console.log(`  Score: ${score}/5  |  Archetype: ${archetype}  |  Legitimacy: ${legitimacy}`);
console.log('─'.repeat(66) + '\n');

View on GitHub (pinned to aac998c7ed)