{"record":{"id":"2772ec2b466f1786","repo":"pbakaus/impeccable","slug":"error-2772ec","errorCode":null,"errorMessage":"Error: {}\n","messagePattern":"Error: (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/detect/src/cli.rs","lineNumber":569,"sourceCode":"        let paths: Vec<String> = if targets.is_empty() {\n            vec![cwd.clone()]\n        } else {\n            targets.clone()\n        };\n        let url_count = paths.iter().filter(|p| URL_RE.is_match(p)).count();\n        let mut shared = if url_count > 1 {\n            engines.url.and_then(|u| u.open_shared())\n        } else {\n            None\n        };\n        // JS: `await createBrowserDetector()` throws before the loop; the\n        // failure is reported once and every URL target is skipped (#711).\n        let mut browser_setup_failed = false;\n        if let Some(s) = shared.as_deref() {\n            if let Err(e) = s.ensure_launched() {\n                browser_setup_failed = true;\n                ctx.had_operational_failure = true;\n                ctx.io.err(&format!(\"Error: {}\\n\", e.message));\n            }\n        }\n        if browser_setup_failed {\n            if let Some(s) = shared.take() {\n                s.close();\n            }\n        }\n        let result = scan_targets(\n            &mut ctx,\n            &paths,\n            shared.as_deref(),\n            browser_setup_failed,\n            &mut all,\n        );\n        if let Some(s) = shared {\n            s.close();\n        }\n        result?;","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/detect/src/cli.rs#L551-L587","documentation":"When shared browser-based scanning is requested, the CLI launches a shared browser once up front (`ensure_launched()`); if that fails it marks an operational failure, prints `Error: <message>` to stderr, closes the shared browser, and (per the accompanying comment) every URL target in the run is skipped so the failure is reported exactly once. This covers browser install/launch problems rather than per-URL fetch errors.","triggerScenarios":"Running `impeccable detect <url> ...` where the shared browser cannot start: the browser binary is missing or not downloaded, launch times out, the platform lacks deps, or the environment forbids spawning the process (sandboxed CI).","commonSituations":"Fresh CI containers without the bundled browser installed; headless Linux boxes missing shared libraries; sandboxed environments blocking process launch; version mismatch after an engine upgrade changed the pinned browser.","solutions":["Install/repair the browser the engine uses (reinstall the CLI or run its setup/download step) and retry the URL scan.","Check the printed message for the underlying cause (missing binary vs. launch failure) and install missing OS dependencies (`apt-get install` the needed libs on CI Linux images).","Scan local paths with `impeccable detect <path>` instead — the local path doesn't require the shared browser.","Ensure the CI job has permission to spawn processes (not a restricted sandbox)."],"exampleFix":"// before\nimpeccable detect https://example.com   # browser binary missing\n// after\n# install engine/browser assets first, then\nimpeccable detect https://example.com","handlingStrategy":"fallback","validationCode":"import { execFileSync } from \"node:child_process\";\n// verify browser availability before scanning URLs\nexecFileSync(\"impeccable\", [\"detect\", \"--help\"], { stdio: \"ignore\" });\n// ensure any setup/download step has run in this environment","typeGuard":null,"tryCatchPattern":"try {\n  execFileSync(\"impeccable\", [\"detect\", url], { stdio: \"pipe\" });\n} catch (e) {\n  if (/Error: /.test(e.stderr?.toString() ?? \"\") && isUrlTarget(url)) {\n    console.error(`Browser unavailable; falling back to local scan or skipping ${url}`);\n  }\n}","preventionTips":["Run the engine's browser setup/download step in CI before URL scans","Install headless browser OS dependencies in container images","Prefer local-path scans in environments where process spawning is restricted","Fail fast with a preflight browser launch check"],"tags":["cli","browser","launch","url-scan"],"backgroundTag":"connection-refused","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}