{"record":{"id":"9453bb9852131c74","repo":"stablyai/orca","slug":"orca-electron-package-retry-delays-ms-must-contain","errorCode":null,"errorMessage":"ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers","messagePattern":"ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/install-electron-package-binary.mjs","lineNumber":193,"sourceCode":"      console.warn(\n        `[electron-package] Transient Electron download failure (${formatDownloadError(error)}); ` +\n          `retrying in ${retryDelay}ms (${attempt + 2}/${retryDelays.length + 1}).`\n      )\n      rmSync(downloadOptions.cacheRoot, { recursive: true, force: true })\n      await new Promise((resolveDelay) => setTimeout(resolveDelay, retryDelay))\n    }\n  }\n}\n\nfunction getDownloadRetryDelays() {\n  const configured = process.env.ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS\n  if (!configured) {\n    return [1_000, 3_000]\n  }\n\n  const delays = configured.split(',').map(Number)\n  if (delays.some((delay) => !Number.isSafeInteger(delay) || delay < 0)) {\n    throw new Error('ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers')\n  }\n  return delays\n}\n\nfunction isTransientDownloadError(error) {\n  for (const candidate of getErrorChain(error)) {\n    if (transientDownloadErrorCodes.has(candidate?.code)) {\n      return true\n    }\n    const statusCode = candidate?.statusCode ?? candidate?.response?.statusCode\n    if (\n      statusCode === 408 ||\n      statusCode === 425 ||\n      statusCode === 429 ||\n      (statusCode >= 500 && statusCode < 600)\n    ) {\n      return true\n    }","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/install-electron-package-binary.mjs#L175-L211","documentation":"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].","triggerScenarios":"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.","commonSituations":"CI config with a trailing comma or whitespace; a copy-pasted '1s' style string instead of milliseconds; a sign prefix.","solutions":["Unset the variable to use the default [1000, 3000] schedule.","Provide a plain comma-separated list of non-negative integer milliseconds, e.g. '1000,3000,5000'.","Remove trailing/leading commas and surrounding whitespace."],"exampleFix":"# before\nexport ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS='1000, 3000,'\n\n# after\nunset ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS","handlingStrategy":"validation","validationCode":"function parseRetryDelays(raw) {\n  if (!raw) return [1000, 3000]\n  const delays = raw.split(',').map((s) => Number(s.trim()))\n  if (delays.some((d) => !Number.isSafeInteger(d) || d < 0)) {\n    throw new Error('ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS must contain non-negative integers')\n  }\n  return delays\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer leaving ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS unset to use the default schedule.","When setting it, use plain comma-separated integers in milliseconds with no trailing comma."],"tags":["validation","electron","environment"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}