Skip to content

./setup hangs on "Installing Playwright Chromium" (macOS arm64); re-running spawns multiple stuck processes #2136

Closed

Description

@francoag17

Environment

  • gstack: v1.58.5.0 (commit 11de390)
  • macOS 15 (Darwin 25.5.0), Apple Silicon (arm64)
  • bun 1.3.14, node v24.16.0
  • Fresh install via the documented one-liner

What happens
./setup reaches Installing Playwright Chromium... and never returns. The browser binary (browse/dist/browse) builds fine and Chromium downloads to 100% on the first run, but the step does not complete, so the script never reaches the Claude skill-linking block (link_claude_skill_dirs, setup line ~983). Result: only the gstack router skill is registered — none of the flat-name skills (/qa, /ship, /review, …) get linked into ~/.claude/skills/.

Re-running ./setup to retry makes it worse: each invocation launches another bash ./setup + node .../playwright install chromium + oopDownloadBrowserMain.js that also hangs, so several stuck process trees accumulate:

node .../node_modules/.bin/playwright install chromium
bash ./setup --host claude --no-prefix
node .../playwright-core/lib/server/registry/oopDownloadBrowserMain.js

Likely root cause
ensure_playwright_browser() (setup line 252) verifies Chromium on macOS with a bun-based launch:

bun --eval 'import { chromium } from "playwright"; const browser = await chromium.launch(); await browser.close();'

This appears to fail/hang on macOS arm64 (similar to the Bun pipe bug oven-sh/bun#4253 that the code already works around with Node on Windows). Because the check returns non-zero, setup believes Chromium is missing on every run and re-enters bunx playwright install chromium (line 483), which itself hangs — an effectively permanent reinstall loop. Chromium is in fact already present under ~/Library/Caches/ms-playwright/.

Workaround that fixed it
Kill the stuck processes, then link skills directly without touching the Chromium step:

pkill -f "gstack/setup"; pkill -f "playwright install chromium"; pkill -f oopDownloadBrowserMain
~/.claude/skills/gstack/bin/gstack-relink   # "Relinked 53 skills as flat names"

After this, all skills (/qa, etc.) register correctly.

Suggested fixes

  1. Use the Node-based launch check on macOS too (not only Windows), or add a timeout around the bun chromium.launch() probe so a hung probe can't force a reinstall.
  2. Guard the install step against re-entry / wrap bunx playwright install chromium in a timeout, and detect an already-downloaded Chromium in ~/Library/Caches/ms-playwright/ before reinstalling.
  3. Consider running link_claude_skill_dirs before the Chromium step (or in a trap/finally) so a browser-download failure doesn't leave skills unregistered.

Activity

  1. shmoobies commented on Jul 11, 2026

    @shmoobies

    Windows 11 pro similar behavior with workaround.

    Summary

    On Windows, the Playwright browser install invoked by ./setup downloads each browser to 100%, then dies during the extraction step without printing an error. Because ensure_playwright_browser is a hard gate that exit 1s before the skill-linking steps, the entire install is blocked and zero skills get registered — even though most skills don't need a browser.

    Environment

    • OS: Windows 11 Pro, Version 10.0.26200.8655
    • Shell: Git Bash / MSYS (setup run via bash)
    • gstack: VERSION 1.60.1.0, commit 7c9df1c
    • Node: v24.16.0 (C:\Program Files\nodejs)
    • Bun: 1.3.14
    • Playwright: [email protected] / [email protected]
    • Browser build: Chrome for Testing 145.0.7632.6, Playwright chromium v1208
    • Google Chrome is installed on the machine (C:\Program Files\Google\Chrome\Application\chrome.exe).

    Symptoms / reproduction

    Observed consistently across three invocations:

    1. ./setup (uses bunx playwright install chromium): chromium (chrome-win64) downloads to 100%, then the process stalls. The second browser (chrome-headless-shell) download never begins — no further output for 40+ minutes.
    2. node node_modules/playwright/cli.js install chromium chromium-headless-shell: same — first browser reaches 100%, then stalls before the second download starts.
    3. ... install chromium-headless-shell (single browser): downloads to 100%, then the process dies during extraction. The target dir contains only:
      chromium_headless_shell-1208/chrome-headless-shell-win64/ABOUT
      chromium_headless_shell-1208/chrome-headless-shell-win64/LICENSE.headless_shell
      
      The actual chrome-headless-shell.exe and DLLs are never written, and no INSTALLATION_COMPLETE marker is created. No error is printed to stdout/stderr.

    What was ruled out

    • Not the network / CDN: curl -fsSL downloaded both zips fully and reliably (chrome-headless-shell-win64.zip 114,056,639 B; chrome-win64.zip 181,196,793 B).
    • Not Windows Defender: Get-MpThreatDetection and Get-MpThreat both return empty — nothing was quarantined.
    • Root cause of the extractor failure itself is unconfirmed — the failure point is Playwright's post-download unzip step in this environment, but the underlying reason it dies was not isolated.

    Secondary issue (data loss during recovery)

    When a browser dir is left incomplete (no INSTALLATION_COMPLETE marker), the next playwright install run garbage-collects it (Removing unused browser at chromium-1208). So installing the two browsers in separate commands can delete a previously-good full-chromium when you subsequently install only the headless shell — making piecemeal recovery lose ground.

    Impact

    • ./setup never reaches skill linking → no gstack skills registered.
    • The browser gate blocks even the ~50 skills that never touch a browser (/review, /ship, /plan-*, /codex, etc.).

    Workaround that resolved it (manual browser install, bypassing Playwright's extractor)

    1. curl both zips from the CDN (URLs are printed in the setup log):
      • https://cdn.playwright.dev/builds/cft/145.0.7632.6/win64/chrome-headless-shell-win64.zip
      • https://cdn.playwright.dev/builds/cft/145.0.7632.6/win64/chrome-win64.zip
    2. Extract each with native Expand-Archive (each zip has a single top-level folder).
    3. Place into %LOCALAPPDATA%\ms-playwright\chromium_headless_shell-1208\ and ...\chromium-1208\.
    4. Write an empty INSTALLATION_COMPLETE marker file in each <browserDir> (Playwright checks <browserDir>/INSTALLATION_COMPLETE).
    5. Verify: node -e "require('playwright').chromium.launch()" (bundled headless — the exact call ensure_playwright_browser makes) → succeeds.
    6. Re-run ./setup → browser gate passes, all ~55 skills link, exit 0. Verified end-to-end afterward: browse goto https://example.com returned 200 and browse text read the page back.

    Suggestions (take or leave)

    • Decouple skill linking from the browser install. Let ./setup register skills even if the browser step fails, and emit a warning like "browser unavailable — /browse, /qa, /design-review will not work until fixed". This alone would make the failure non-blocking.
    • Add a timeout + explicit error around the Playwright install/extract so a stuck extraction fails loudly instead of hanging silently (the 40-minute no-output stall was the hardest part to diagnose).
    • Offer a "use installed Chrome" escape hatch on Windows. chromium.launch({ channel: 'chrome' }) worked perfectly against the machine's installed Chrome with no download. Note: gstack's headed path already honors GSTACK_CHROMIUM_PATH (browse/src/browser-manager.ts), but the headless launch() (~line 372) does not pass executablePath/channel, so there's currently no way to point the headless daemon at system Chrome.
  2. time-attack commented on Jul 15, 2026

    @time-attack
    Contributor

    @16francej — recommend closing this issue, but only after a corrected #2233 passes hang, re-entry, descendant cleanup, stale-lock recovery, and skill-registration checks. The reports describe browser extraction blocking registration and repeated setup runs leaving processes on macOS and Windows. Preserve #1703 as the likely Node and Playwright trigger.

  3. garrytan commented on Aug 15, 2026

    @garrytan
    Owner

    Fixed in fork-port wave 2, three parts: the Playwright Chromium probe is bounded by a 90s deadline that SIGKILLs the whole probe tree on timeout (no more wedged ./setup), the install runs under a single-flight lock with stale-lock self-heal (a killed prior setup can't wedge the next one, and re-runs can't stack stuck processes), and EXIT traps chain instead of clobbering each other.

    Commits: b9cd0949 (setup-hang fix in the housekeeping sweep), 00220256 (stale Chromium-install lock self-heals), bebb09b0 (EXIT trap chaining + whole-tree reaping).
    The deadline/lock logic lives in setup itself (_wait_with_deadline, gstack-playwright-install.lock) — shell-level, no dedicated unit test.

    Ships in #2577 (v1.65.0.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions