{"record":{"id":"9ceb89b61cbe7a54","repo":"santifer/career-ops","slug":"verify-could-not-launch-chromium-run-npx-playw","errorCode":null,"errorMessage":"--verify could not launch Chromium (run \"npx playwright install chromium\" or re-run without --verify): ${err.message}","messagePattern":"--verify could not launch Chromium \\(run \"npx playwright install chromium\" or re-run without --verify\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scan.mjs","lineNumber":2701,"sourceCode":"  let createHeadedPageProvider;\n  let newLivenessPage;\n  let jitteredDelayMs;\n  let sleep;\n  try {\n    ({ chromium } = await import('playwright'));\n    ({ checkUrlLiveness, checkUrlLivenessWithFallback, createHeadedPageProvider, newLivenessPage, jitteredDelayMs, sleep } = await import('./liveness-browser.mjs'));\n  } catch (err) {\n    throw new Error(\n      `--verify requires Playwright with Chromium (run \"npx playwright install chromium\"): ${err.message}`,\n      { cause: err },\n    );\n  }\n\n  let browser;\n  try {\n    browser = await chromium.launch({ headless: true });\n  } catch (err) {\n    throw new Error(\n      `--verify could not launch Chromium (run \"npx playwright install chromium\" or re-run without --verify): ${err.message}`,\n      { cause: err },\n    );\n  }\n\n  // Three permanent buckets + one transient passthrough:\n  //   verified  → active pages and transient nav errors (retry next scan)\n  //   expired   → classifier-confirmed dead postings (HTTP 4xx, redirect markers,\n  //               body patterns, listing pages, insufficient content)\n  //   dropped   → page loaded but classifier saw no Apply control. --verify is an\n  //               opt-in stricter filter; keeping these defeats the purpose.\n  //   invalid   → up-front URL guard rejections (malformed / non-http / private)\n  const verified = [];\n  const expired = [];\n  const dropped = [];\n  const invalid = [];\n  const migrated = [];\n","sourceCodeStart":2683,"sourceCodeEnd":2719,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/scan.mjs#L2683-L2719","documentation":"After Playwright imports successfully, scan.mjs launches headless Chromium for --verify; if chromium.launch() rejects, this error is thrown. Unlike the import error, this means Playwright itself is present but the browser could not start (missing browser executable, missing system libraries, or sandbox restrictions).","triggerScenarios":"chromium.launch({ headless: true }) fails because Chromium binaries were never downloaded (`playwright install` skipped), host OS libraries are missing (common in minimal Docker images), or launch is blocked in a restricted sandbox/container.","commonSituations":"CI containers without libnss3/libatk etc.; environments with no HOME or no write access to the Playwright cache; running inside restricted Docker without --no-sandbox workarounds; partial browser download.","solutions":["Run `npx playwright install chromium` (add `--with-deps` on Linux to install system libraries)","On bare containers, install OS deps: `npx playwright install-deps chromium` or use the official Playwright Docker image","If the executable path is custom, set PLAYWRIGHT_BROWSERS_PATH or launch with executablePath","Re-run the scan without --verify, which the message itself suggests as a fallback"],"exampleFix":"// before (Dockerfile)\nRUN npm ci\nCMD [\"node\", \"scan.mjs\", \"--verify\"]   # launch fails: missing libs\n// after (Dockerfile)\nRUN npm ci && npx playwright install --with-deps chromium\nCMD [\"node\", \"scan.mjs\", \"--verify\"]","handlingStrategy":"try-catch","validationCode":"let chromium;\ntry { ({ chromium } = await import('playwright')); } catch { /* handled elsewhere */ }\nif (chromium) {\n  try { await chromium.launch({ headless: true }); console.log('chromium OK'); }\n  catch (e) { console.error('Chromium cannot launch:', e.message); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  browser = await chromium.launch({ headless: true });\n} catch (err) {\n  if (err.message.includes('--verify could not launch') || /Executable doesn't exist|missing libraries/i.test(err.cause?.message ?? '')) {\n    console.error('Run `npx playwright install --with-deps chromium` or re-run without --verify');\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Use `npx playwright install --with-deps chromium` in CI/Linux images so OS libraries are installed","Set PLAYWRIGHT_BROWSERS_PATH explicitly in environments with restricted HOME/cache access","Smoke-test chromium.launch() in a setup/doctor step before running long scans","Prefer the official Playwright Docker image in containers"],"tags":["playwright","chromium","launch-failure","container"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}