{"record":{"id":"32c56566d257c66b","repo":"can1357/oh-my-pi","slug":"browser-archive-did-not-contain-its-expected-execu","errorCode":null,"errorMessage":"Browser archive did not contain its expected executable: ${executablePath}","messagePattern":"Browser archive did not contain its expected executable: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/utils/src/browsers.ts","lineNumber":268,"sourceCode":"\tconst stagingPath = path.join(options.cacheDir, `.browser-${nonce}`);\n\ttry {\n\t\tawait downloadArchive(\n\t\t\tgetDownloadUrl(options.browser, platform, options.buildId, options.baseUrl),\n\t\t\tarchivePath,\n\t\t\toptions.downloadProgressCallback,\n\t\t);\n\t\tawait extractArchive(archivePath, stagingPath, { limits: BROWSER_ARCHIVE_LIMITS });\n\t\tawait fsp.mkdir(path.dirname(installPath), { recursive: true });\n\t\tawait fsp.rm(installPath, { recursive: true, force: true });\n\t\tawait fsp.rename(stagingPath, installPath);\n\t} finally {\n\t\tawait Promise.all([\n\t\t\tfsp.rm(archivePath, { force: true }).catch(() => {}),\n\t\t\tfsp.rm(stagingPath, { recursive: true, force: true }).catch(() => {}),\n\t\t]);\n\t}\n\tif (!(await pathExists(executablePath)))\n\t\tthrow new Error(`Browser archive did not contain its expected executable: ${executablePath}`);\n\treturn { browser: options.browser, buildId: options.buildId, platform, path: installPath, executablePath };\n}\n\nfunction chromeChannelName(tag: string): string | undefined {\n\tswitch (tag) {\n\t\tcase BrowserTag.STABLE:\n\t\t\treturn \"Stable\";\n\t\tcase BrowserTag.BETA:\n\t\t\treturn \"Beta\";\n\t\tcase BrowserTag.DEV:\n\t\t\treturn \"Dev\";\n\t\tcase BrowserTag.CANARY:\n\t\t\treturn \"Canary\";\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/browsers.ts#L250-L286","documentation":"After downloading and unpacking the Chrome archive into a staging dir and moving it into place, install() verifies the expected executable exists at computeExecutablePath's location; if it does not, the archive content did not match the expected layout (or extraction failed silently) and this Error is thrown. Staging artifacts are cleaned up before throwing.","triggerScenarios":"install() completes the download+extract flow but pathExists(executablePath) is false — e.g. the upstream archive layout changed (folder renamed), extraction skipped/failed for a member, partial/corrupt archive extracted without error, or an antivirus removed the binary.","commonSituations":"Google renaming chrome-linux64/ to something else in a new build; disk-full or permission errors during extraction swallowed by cleanup; corrupted download behind a proxy that returned an HTML error page with 200; security software quarantining chrome.exe.","solutions":["Delete the partial install dir under cacheDir and retry the install.","Verify the download by inspecting the archive (list entries) to confirm the expected chrome-* folder layout exists.","Check disk space and directory permissions in cacheDir.","Check antivirus/quarantine logs if the binary vanished post-extract.","Try a different buildId (pin an exact version) in case the specific build's layout differs."],"exampleFix":"// before\nconst b = await install({ browser: Browser.CHROME, buildId, cacheDir });\n// after\ntry {\n  const b = await install({ browser: Browser.CHROME, buildId, cacheDir });\n} catch (err) {\n  if (String(err).includes('did not contain its expected executable')) {\n    await fsp.rm(path.join(cacheDir, 'chrome', buildId), { recursive: true, force: true });\n    // retry with a pinned known-good buildId\n  }\n  throw err;\n}","handlingStrategy":"retry","validationCode":"// preflight: confirm the build's archive exists and check disk space\nconst head = await fetch(`https://storage.googleapis.com/chrome-for-testing-public/${buildId}/linux64/chrome-linux64.zip`, { method: 'HEAD' });\nif (!head.ok) throw new Error(`No archive for ${buildId}; pick another buildId`);\nconst stat = await fsp.statfs?.(cacheDir).catch(() => null);\n// ensure enough free space before downloading","typeGuard":"null","tryCatchPattern":"let installed;\nfor (let attempt = 0; attempt < 2 && !installed; attempt++) {\n  try {\n    installed = await install({ browser: Browser.CHROME, buildId, cacheDir });\n  } catch (err) {\n    if (/did not contain its expected executable/.test(String(err)) && attempt === 0) {\n      await fsp.rm(path.join(cacheDir, 'chrome', buildId), { recursive: true, force: true }); // clear partial install, retry\n      continue;\n    }\n    throw err;\n  }\n}","preventionTips":["Ensure adequate disk space and write permissions under cacheDir.","Avoid proxies that rewrite 404s into 200 HTML bodies (corrupt 'archives').","Pin known-good buildIds whose archive layout you've verified.","Clean stale/partial cacheDir entries before reinstalling."],"tags":["archive-extraction","browser-download","corrupt-download","filesystem"],"backgroundTag":"browser-install-missing-executable","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}