stablyai/orca · error · Error

ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negat

Error message

ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers

What it means

getDownloadRetryDelays parses the comma-separated ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS env var into a retry-delay schedule for the Electron download. It throws if any token fails Number.isSafeInteger or is negative, because malformed delays would either schedule NaN-ms retries or silently disable retrying. When unset, it returns a sane default of [1000, 3000].

Source

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

      console.warn(
        `[electron-package] Transient Electron download failure (${formatDownloadError(error)}); ` +
          `retrying in ${retryDelay}ms (${attempt + 2}/${retryDelays.length + 1}).`
      )
      rmSync(downloadOptions.cacheRoot, { recursive: true, force: true })
      await new Promise((resolveDelay) => setTimeout(resolveDelay, retryDelay))
    }
  }
}

function getDownloadRetryDelays() {
  const configured = process.env.ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS
  if (!configured) {
    return [1_000, 3_000]
  }

  const delays = configured.split(',').map(Number)
  if (delays.some((delay) => !Number.isSafeInteger(delay) || delay < 0)) {
    throw new Error('ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers')
  }
  return delays
}

function isTransientDownloadError(error) {
  for (const candidate of getErrorChain(error)) {
    if (transientDownloadErrorCodes.has(candidate?.code)) {
      return true
    }
    const statusCode = candidate?.statusCode ?? candidate?.response?.statusCode
    if (
      statusCode === 408 ||
      statusCode === 425 ||
      statusCode === 429 ||
      (statusCode >= 500 && statusCode < 600)
    ) {
      return true
    }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Unset the variable to use the default [1000, 3000] schedule.
  2. Provide a plain comma-separated list of non-negative integer milliseconds, e.g. '1000,3000,5000'.
  3. Remove trailing/leading commas and surrounding whitespace.

Example fix

# before
export ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS='1000, 3000,'

# after
unset ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS
Defensive patterns

Strategy: validation

Validate before calling

function parseRetryDelays(raw) {
  if (!raw) return [1000, 3000]
  const delays = raw.split(',').map((s) => Number(s.trim()))
  if (delays.some((d) => !Number.isSafeInteger(d) || d < 0)) {
    throw new Error('ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers')
  }
  return delays
}

Prevention

When it happens

Trigger: Setting ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS to a value containing a float ('1.5'), a negative ('-1'), a non-numeric token ('abc'), a trailing comma ('1000,3000,' → NaN), or a value beyond MAX_SAFE_INTEGER.

Common situations: CI config with a trailing comma or whitespace; a copy-pasted '1s' style string instead of milliseconds; a sign prefix.

Related errors


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