stablyai/orca · critical · Error

[electron-package] ${command.label} failed with status ${res

Error message

[electron-package] ${command.label} failed with status ${result.status}.

What it means

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.

Source

Thrown at config/scripts/install-electron-package-binary.mjs:253

  }
  return error instanceof Error ? error.message : String(error)
}

function extractElectronArchive(zipPath, extractDir) {
  mkdirSync(extractDir, { recursive: true })
  // Why: extract-zip/Electron install.js can leave Node 24 with an unsettled
  // promise and no active handles on CI. Host unzip tools fail synchronously.
  const command = getExtractorCommand(zipPath, extractDir)
  const result = spawnSync(command.file, command.args, {
    encoding: 'utf8',
    stdio: ['ignore', 'pipe', 'pipe']
  })

  if (result.error) {
    throw result.error
  }
  if (result.status !== 0) {
    throw new Error(formatExtractorFailure(command, result))
  }
}

function moveExtractedElectronDist(extractDir, electronDistDir) {
  rmSync(electronDistDir, { recursive: true, force: true })
  try {
    // Why: macOS Electron archives rely on framework symlinks. Moving the
    // verified tree preserves them exactly; copying has broken them in CI.
    renameSync(extractDir, electronDistDir)
  } catch (/** @type {any} */ err) {
    if (err?.code !== 'EXDEV') {
      throw err
    }
    cpSync(extractDir, electronDistDir, {
      recursive: true,
      dereference: false,
      verbatimSymlinks: true
    })

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Re-run the install — the download path retries transient errors, and a fresh download often fixes truncation.
  2. Install unzip (or set ORCA_UNZIP_BIN) on Linux; ensure PowerShell is available (or set ORCA_POWERSHELL_BIN) on Windows.
  3. Read the formatted stderr in the message to identify the extractor-specific failure.
  4. Point ORCA_ELECTRON_PACKAGE_EXTRACTOR at a known-good extractor script if the host tools are unreliable.

Example fix

# before
# CI minimal image missing unzip -> 'unzip failed with status 127'

# after
apt-get install -y unzip
# or pin a binary:
export ORCA_UNZIP_BIN=/usr/bin/unzip
Defensive patterns

Strategy: retry

Validate before calling

const extractor = process.env.ORCA_ELECTRON_PACKAGE_EXTRACTOR
 || (osPlatform() === 'win32' ? 'powershell' : 'unzip')
// verify the chosen tool exists before relying on it
if (!process.env.ORCA_ELECTRON_PACKAGE_EXTRACTOR && osPlatform() !== 'win32') {
  spawnSync('unzip', ['-v']) // throws on missing binary via non-zero
}

Try / catch

try {
  extractElectronArchive(zipPath, extractDir)
} catch (err) {
  console.warn(`Extract failed (${err.message}); clearing cache and retrying download`)
  rmSync(cacheRoot, { recursive: true, force: true })
  throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: Flaky CI producing a partial download; minimal Linux image without unzip; Windows execution policy blocking Expand-Archive; checksum mismatch undetected before extract.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/8e359aebcb7ba46e. Report an issue: GitHub.