{"record":{"id":"503821f7fc1d45b2","repo":"oven-sh/bun","slug":"scannerfailed","errorCode":null,"errorMessage":"ScannerFailed","messagePattern":"ScannerFailed","errorType":"exception","errorClass":"bun_install::Error","httpStatus":null,"severity":"error","filePath":"src/install/error.rs","lineNumber":115,"sourceCode":"    #[error(\"InvalidIPCFormat\")]\n    InvalidIPCFormat,\n    #[error(\"MissingIPCType\")]\n    MissingIPCType,\n    #[error(\"InvalidIPCType\")]\n    InvalidIPCType,\n    #[error(\"MissingErrorCode\")]\n    MissingErrorCode,\n    #[error(\"InvalidErrorCode\")]\n    InvalidErrorCode,\n    #[error(\"UnknownErrorCode\")]\n    UnknownErrorCode,\n    #[error(\"SecurityScannerNotFound\")]\n    SecurityScannerNotFound,\n    #[error(\"SecurityScannerNotInDependencies\")]\n    SecurityScannerNotInDependencies,\n    #[error(\"InvalidScannerVersion\")]\n    InvalidScannerVersion,\n    #[error(\"ScannerFailed\")]\n    ScannerFailed,\n    #[error(\"UnknownMessageType\")]\n    UnknownMessageType,\n    #[error(\"MissingAdvisoriesField\")]\n    MissingAdvisoriesField,\n    #[error(\"SecurityScannerFailed\")]\n    SecurityScannerFailed,\n    #[error(\"SecurityScannerTerminated\")]\n    SecurityScannerTerminated,\n    #[error(\"InvalidAdvisoriesFormat\")]\n    InvalidAdvisoriesFormat,\n    #[error(\"InvalidAdvisoryFormat\")]\n    InvalidAdvisoryFormat,\n    #[error(\"MissingPackageField\")]\n    MissingPackageField,\n    #[error(\"InvalidPackageField\")]\n    InvalidPackageField,\n    #[error(\"EmptyPackageField\")]","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/error.rs#L97-L133","documentation":"The security scanner subprocess replied over IPC with error code SCAN_FAILED — the scanner ran but could not complete its scan. Bun prints the scanner's human-readable `message` field (if present) and then fails with ScannerFailed (security_scanner.rs:1673-1682).","triggerScenarios":"The scanner process starts, receives the package list, and hits an internal failure: unreadable advisory database, network error reaching an vulnerability API, malformed internal input, or a crash it catches and reports as SCAN_FAILED.","commonSituations":"Offline CI runner where the scanner cannot fetch its advisories database; scanner's database cache corrupted; scanner's own API token expired; scanner encountering a package manifest it cannot parse.","solutions":["Check the printed 'Security scanner failed: <message>' line — it carries the scanner's own reason; act on it first","Re-run `bun install` after fixing connectivity (the scanner usually needs network to fetch advisories)","Clear or rebuild the scanner's local cache/database per its documentation","If the failure is persistent and environmental, temporarily remove `security_scanner` from bunfig.toml to unblock installs, then restore it"],"exampleFix":"# before: CI offline, scanner cannot fetch advisory DB → ScannerFailed\n# after: pre-cache the scanner DB in a prior CI step\ncache:  # .gitlab-ci.yml / GitHub Actions style\n  paths:\n    - .scanner-cache/\n- run: scanner-cli --update-db   # warms cache\n- run: bun install","handlingStrategy":"retry","validationCode":"# warm the scanner's database/network prerequisites before installing\ncurl -fsS https://advisories.example.com/health > /dev/null || echo \"scanner DB unreachable\" >&2","typeGuard":null,"tryCatchPattern":"# transient scanner failures (DB fetch, network): retry once before failing CI\nbun install || bun install","preventionTips":["Pre-fetch/cache the scanner's advisory database in a CI cache step","Provide required tokens to the scanner via env before bun install runs","Keep the bunfig security_scanner optional in environments where the scan is best-effort"],"tags":["security-scanner","scan-failure","install","ci"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}