Repository navigation
Embedded bun runtime hangs indefinitely on bun add during bootstrap on Linux (BunInstallFailedError) #11836
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingperfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization
Description
Description
Summary
OpenCode v1.1.48 fails to launch on Ubuntu 24.04 (x86_64). The TUI renders a blank screen because the embedded bun runtime hangs indefinitely when trying to install @opencode-ai/plugin during bootstrap. This is related to #5223 but the .npmrc removal workaround
does not resolve it.
Environment
- OpenCode version: 1.1.48
- OS: Ubuntu 24.04.3 LTS (Noble Numbat)
- Kernel: 6.14.0-37-generic x86_64
- Node: v24.13.0
- npm: 11.6.2
- Embedded bun: 1.3.5
- Terminal: kitty (xterm-kitty, truecolor)
- Network: npm registry is reachable (
curl https://registry.npmjs.orgreturns 200)
Symptoms
- Running
opencodeshows a blank TUI — no UI elements render - Logs show bootstrap hangs at the first
bun addcall and never progresses:
INFO service=bun cmd=["/home/user/.opencode/bin/opencode","add","@opencode-ai/plugin@1.1.48","--exact"] cwd=/home/user/.config/opencode running No further log output after this line. - When the bun subprocess does eventually get killed (e.g. by SIGHUP), it exits with code 129 and produces
BunInstallFailedError:
INFO service=bun code=129 stdout=bun add v1.3.5 (1e86cebd) stderr=Resolving dependencies done
ERROR service=plugin pkg=opencode-anthropic-auth version=0.0.13 error=BunInstallFailedError failed to install builtin plugin - Each failed launch leaves orphaned processes behind. Subsequent launches also hang because those zombie processes hold locks on
node_modules.
Workaround
Pre-install the packages using system npm so bun finds existing node_modules and a lockfile to migrate from (completes in milliseconds
instead of hanging):
# Kill any stale processes first
pkill -9 -f opencode
# Clean up corrupted state
rm -rf ~/.cache/opencode/node_modules ~/.config/opencode/node_modules ~/.opencode/node_modules
# Pre-install via npm
cd ~/.config/opencode && npm install --save-exact @opencode-ai/plugin@1.1.48
cd ~/.opencode && npm install --save-exact @opencode-ai/plugin@1.1.48
cd ~/.cache/opencode && npm install --save-exact opencode-anthropic-auth@0.0.13 @gitlab/opencode-gitlab-auth@1.3.2
# Now opencode launches successfully
opencode
After this, bun's add command succeeds with code 0 because it migrates from the existing package-lock.json rather than resolving from
scratch.
Root cause
The embedded bun 1.3.5 runtime hangs indefinitely when resolving packages from the npm registry on a cold install (no existing node_modules
or lockfile). The npm registry is reachable and system npm installs the same packages without issue. OPENCODE_DISABLE_DEFAULT_PLUGINS=1
does not help because the hang occurs on the core @opencode-ai/plugin, not the default auth plugins.
Expected behavior
OpenCode should either:
1. Ship with its core plugin bundled so bootstrap doesn't require a network install
2. Add a timeout to the bun subprocess so it fails gracefully instead of hanging forever
3. Fall back to system npm/npx if the embedded bun fails Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingperfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization
Activity
github-actions commentedon Feb 2, 2026
This issue might be a duplicate of existing issues. Please check:
BunInstallFailedError#10614: opencode auth login throwBunInstallFailedErrorFeel free to ignore if none of these address your specific case.
linuxmobile commentedon Feb 3, 2026
Same issue. @adamdotdevin Did you know? there's a lot of issues with the same error, i'm trying to deal with it all day
0xd3e commentedon Feb 4, 2026
I had the same issue and remembered an issue I had with bun when installing packages.
So I did the same that I did back then, which was setting the IPv6 configuration to link-local only. This fixed the issue for me.
There is a bun issue about that: oven-sh/bun#4988
The issue also has some comments regarding Linux.
github-actions commentedon Apr 6, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.