{"record":{"id":"8cff5aa6aca35dc8","repo":"santifer/career-ops","slug":"failed-to-sync-pdf-flags-e-message","errorCode":null,"errorMessage":"⚠️  Failed to sync PDF flags: ${e.message}","messagePattern":"⚠️  Failed to sync PDF flags: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"merge-tracker.mjs","lineNumber":1817,"sourceCode":"  // is written.\n  if (!existsSync(MERGED_DIR)) mkdirSync(MERGED_DIR, { recursive: true });\n  const archivable = tsvFiles.filter(f => !failedAdditions.includes(f));\n  for (const file of archivable) {\n    renameSync(join(ADDITIONS_DIR, file), join(MERGED_DIR, file));\n  }\n  console.log(`\\n✅ Moved ${archivable.length} TSVs to merged/`);\n}\n\nconsole.log(`\\n📊 Summary: +${added} added, 🔄${updated} updated, ⏭️${skipped} skipped${failedAdditions.length ? `, ❌${failedAdditions.length} NOT merged` : ''}`);\nif (DRY_RUN) console.log('(dry-run — no changes written)');\ntrackerLock.release();\n\n// Sync PDF flags (idempotent; uses its own lock/transaction)\nif (!DRY_RUN) {\n  try {\n    execFileSync(process.execPath, [join(CAREER_OPS_CODE_ROOT, 'sync-pdf-flags.mjs')], { stdio: 'inherit' });\n  } catch (e) {\n    console.warn(`⚠️  Failed to sync PDF flags: ${e.message}`);\n  }\n}\n\n// Optional verify\nif (VERIFY && !DRY_RUN) {\n  console.log('\\n--- Running verification ---');\n  try {\n    execFileSync(process.execPath, [join(CAREER_OPS_CODE_ROOT, 'verify-pipeline.mjs')], { stdio: 'inherit' });\n  } catch (e) {\n    process.exit(1);\n  }\n}\n\n// Any addition that could not be applied fails the run. The TSVs stay in the\n// additions dir, so re-running after the tracker is repaired merges them once.\nif (failedAdditions.length > 0) {\n  console.error(\n    `\\n❌ ${failedAdditions.length} addition(s) were NOT merged and were left in ${ADDITIONS_DIR}: ` +","sourceCodeStart":1799,"sourceCodeEnd":1835,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/merge-tracker.mjs#L1799-L1835","documentation":"After writing the merged tracker, merge-tracker.mjs invokes sync-pdf-flags.mjs (in a separate child process with its own lock/transaction) to reconcile the tracker's PDF ✅/❌ column with the actual files in output/. A child-process failure is non-fatal — the merge itself succeeded — so it's surfaced as a warning with the exception message, not a crash.","triggerScenarios":"execFileSync on process.execPath exits non-zero: sync-pdf-flags.mjs threw, the file is missing from CAREER_OPS_CODE_ROOT, the tracker lock is held by another process, or Node itself failed to spawn.","commonSituations":"Concurrent merge/set-status runs contending for the tracker lock; a partial install missing sync-pdf-flags.mjs; a syntax error or crash inside sync-pdf-flags.mjs on a malformed tracker row.","solutions":["Read the child's inherited stderr (printed above the warning) for the underlying cause and fix that first.","Re-run node sync-pdf-flags.mjs manually once the lock is free — it is idempotent.","Check no other merge-tracker/set-status process is holding the shared lock; retry after it exits.","Verify sync-pdf-flags.mjs exists at CAREER_OPS_CODE_ROOT (reinstall/update career-ops if missing)."],"exampleFix":"// diagnosis\n$ node sync-pdf-flags.mjs\nError: lock held by pid 1234\n// after\n$ wait 1234; node sync-pdf-flags.mjs   # idempotent re-run, flags now synced","handlingStrategy":"try-catch","validationCode":"try { execFileSync(process.execPath, [syncPath, '--check'], { stdio: 'pipe' }); } catch (e) { console.error('sync-pdf-flags will fail:', e.message); }","typeGuard":null,"tryCatchPattern":"try {\n  execFileSync(process.execPath, [join(CAREER_OPS_CODE_ROOT, 'sync-pdf-flags.mjs')], { stdio: 'inherit' });\n} catch (e) {\n  console.warn(`⚠️  Failed to sync PDF flags: ${e.message}`);\n  // re-run manually once the lock frees: node sync-pdf-flags.mjs\n}","preventionTips":["Avoid running concurrent merge-tracker/set-status processes — both contend for the tracker lock.","Re-run node sync-pdf-flags.mjs manually after any warning; it is idempotent.","Keep career-ops installed intact so sync-pdf-flags.mjs exists at CAREER_OPS_CODE_ROOT.","Read the child's inherited stderr above the warning to find the root cause quickly."],"tags":["child-process","pdf","sync"],"backgroundTag":"git-command-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"}