{"record":{"id":"8e359aebcb7ba46e","repo":"stablyai/orca","slug":"electron-package-command-label-failed-with-st","errorCode":null,"errorMessage":"[electron-package] ${command.label} failed with status ${result.status}.","messagePattern":"\\[electron-package\\] (.+?) failed with status (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"config/scripts/install-electron-package-binary.mjs","lineNumber":253,"sourceCode":"  }\n  return error instanceof Error ? error.message : String(error)\n}\n\nfunction extractElectronArchive(zipPath, extractDir) {\n  mkdirSync(extractDir, { recursive: true })\n  // Why: extract-zip/Electron install.js can leave Node 24 with an unsettled\n  // promise and no active handles on CI. Host unzip tools fail synchronously.\n  const command = getExtractorCommand(zipPath, extractDir)\n  const result = spawnSync(command.file, command.args, {\n    encoding: 'utf8',\n    stdio: ['ignore', 'pipe', 'pipe']\n  })\n\n  if (result.error) {\n    throw result.error\n  }\n  if (result.status !== 0) {\n    throw new Error(formatExtractorFailure(command, result))\n  }\n}\n\nfunction moveExtractedElectronDist(extractDir, electronDistDir) {\n  rmSync(electronDistDir, { recursive: true, force: true })\n  try {\n    // Why: macOS Electron archives rely on framework symlinks. Moving the\n    // verified tree preserves them exactly; copying has broken them in CI.\n    renameSync(extractDir, electronDistDir)\n  } catch (/** @type {any} */ err) {\n    if (err?.code !== 'EXDEV') {\n      throw err\n    }\n    cpSync(extractDir, electronDistDir, {\n      recursive: true,\n      dereference: false,\n      verbatimSymlinks: true\n    })","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/install-electron-package-binary.mjs#L235-L271","documentation":"extractElectronArchive extracts the downloaded Electron zip with a host tool chosen by getExtractorCommand (unzip on Unix, PowerShell Expand-Archive on Windows, or a custom node script via ORCA_ELECTRON_PACKAGE_EXTRACTOR). It throws a formatted error (via formatExtractorFailure) when the extractor exits non-zero, including the command label, status, and captured stdout/stderr. This path exists because extract-zip / Electron's own install.js can leave Node with an unsettled promise on CI.","triggerScenarios":"The downloaded Electron zip is corrupt or truncated so unzip/Expand-Archive fails; the chosen extractor binary is missing or errors; ORCA_ELECTRON_PACKAGE_EXTRACTOR points at a script that exits non-zero.","commonSituations":"Flaky CI producing a partial download; minimal Linux image without unzip; Windows execution policy blocking Expand-Archive; checksum mismatch undetected before extract.","solutions":["Re-run the install — the download path retries transient errors, and a fresh download often fixes truncation.","Install unzip (or set ORCA_UNZIP_BIN) on Linux; ensure PowerShell is available (or set ORCA_POWERSHELL_BIN) on Windows.","Read the formatted stderr in the message to identify the extractor-specific failure.","Point ORCA_ELECTRON_PACKAGE_EXTRACTOR at a known-good extractor script if the host tools are unreliable."],"exampleFix":"# before\n# CI minimal image missing unzip -> 'unzip failed with status 127'\n\n# after\napt-get install -y unzip\n# or pin a binary:\nexport ORCA_UNZIP_BIN=/usr/bin/unzip","handlingStrategy":"retry","validationCode":"const extractor = process.env.ORCA_ELECTRON_PACKAGE_EXTRACTOR\n || (osPlatform() === 'win32' ? 'powershell' : 'unzip')\n// verify the chosen tool exists before relying on it\nif (!process.env.ORCA_ELECTRON_PACKAGE_EXTRACTOR && osPlatform() !== 'win32') {\n  spawnSync('unzip', ['-v']) // throws on missing binary via non-zero\n}","typeGuard":null,"tryCatchPattern":"try {\n  extractElectronArchive(zipPath, extractDir)\n} catch (err) {\n  console.warn(`Extract failed (${err.message}); clearing cache and retrying download`)\n  rmSync(cacheRoot, { recursive: true, force: true })\n  throw err\n}","preventionTips":["Ensure unzip is installed on Linux CI images (or set ORCA_UNZIP_BIN).","Keep a retry around the download+extract pair so a truncated zip is replaced before failing the build."],"tags":["electron","install","ci"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}