Cant start opencode. #3890

Closed
opened 2026-02-16 17:41:50 -05:00 by yindo · 18 comments
Owner

Originally created by @mattiasmicu on GitHub (Dec 26, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Today when i wanted to continue on a project of mine, i could not start opencode for some reason cause of bun i think. i am not sure if its opencodes fault or bun. this is what i got: mattias@Mattiass-MacBook-Pro Beam % arc
1855 | })
1856 | return result
1857 | }
1858 |
1859 | export function listen(opts: { port: number; hostname: string }) {
1860 | const server = Bun.serve({
^
error: Failed to start server. Is port 0 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:1860:24)
  at server (src/cli/cmd/tui/worker.ts:36:23)
  at server (src/cli/cmd/tui/worker.ts:33:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)

OpenCode version

1.0.203

Steps to reproduce

  1. go in to any directory
  2. type start opencode
  3. and get the error

Screenshot and/or share link

Image

Operating System

MacOS 21.1

Terminal

The cursor terminal and the default terminal that comes with macos

Originally created by @mattiasmicu on GitHub (Dec 26, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Today when i wanted to continue on a project of mine, i could not start opencode for some reason cause of bun i think. i am not sure if its opencodes fault or bun. this is what i got: mattias@Mattiass-MacBook-Pro Beam % arc 1855 | }) 1856 | return result 1857 | } 1858 | 1859 | export function listen(opts: { port: number; hostname: string }) { 1860 | const server = Bun.serve({ ^ error: Failed to start server. Is port 0 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:1860:24) at server (src/cli/cmd/tui/worker.ts:36:23) at server (src/cli/cmd/tui/worker.ts:33:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24) ### OpenCode version 1.0.203 ### Steps to reproduce 1. go in to any directory 2. type start opencode 3. and get the error ### Screenshot and/or share link <img width="1130" height="666" alt="Image" src="https://github.com/user-attachments/assets/765e045b-a64d-4c6d-b21d-ad0d2674857c" /> ### Operating System MacOS 21.1 ### Terminal The cursor terminal and the default terminal that comes with macos
yindo added the bug label 2026-02-16 17:41:50 -05:00
yindo closed this issue 2026-02-16 17:41:50 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 26, 2025):

What if you try running like:

opencode --port 5811 or something that'd be free?

@rekram1-node commented on GitHub (Dec 26, 2025): What if you try running like: `opencode --port 5811` or something that'd be free?
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

Still doesnt work even if i use other ports that are free on my system:

mattias@Mattiass-MacBook-Pro Beam % opencode --
port 5811
2073 | })
2074 | return result
2075 | }
2076 |
2077 | export function listen(opts: { port: number; hostname: string }) {
2078 | const server = Bun.serve({
^
error: Failed to start server. Is port 5811 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:2078:24)
  at server (src/cli/cmd/tui/worker.ts:34:23)
  at server (src/cli/cmd/tui/worker.ts:31:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)
@mattiasmicu commented on GitHub (Dec 26, 2025): Still doesnt work even if i use other ports that are free on my system: mattias@Mattiass-MacBook-Pro Beam % opencode -- port 5811 2073 | }) 2074 | return result 2075 | } 2076 | 2077 | export function listen(opts: { port: number; hostname: string }) { 2078 | const server = Bun.serve({ ^ error: Failed to start server. Is port 5811 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:2078:24) at server (src/cli/cmd/tui/worker.ts:34:23) at server (src/cli/cmd/tui/worker.ts:31:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24)
Author
Owner

@rekram1-node commented on GitHub (Dec 26, 2025):

Do u have too many open files or something?

maybe try:

pkill -f opencode

And then try again

@rekram1-node commented on GitHub (Dec 26, 2025): Do u have too many open files or something? maybe try: pkill -f opencode And then try again
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

i do not have many files open. i recently restarted my system and tried again but it still did not work.

mattias@Mattiass-MacBook-Pro Beam % pkill -f opencode
mattias@Mattiass-MacBook-Pro Beam % opencode
2073 | })
2074 | return result
2075 | }
2076 |
2077 | export function listen(opts: { port: number; hostname: string }) {
2078 | const server = Bun.serve({
^
error: Failed to start server. Is port 0 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:2078:24)
  at server (src/cli/cmd/tui/worker.ts:34:23)
  at server (src/cli/cmd/tui/worker.ts:31:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)
@mattiasmicu commented on GitHub (Dec 26, 2025): i do not have many files open. i recently restarted my system and tried again but it still did not work. mattias@Mattiass-MacBook-Pro Beam % pkill -f opencode mattias@Mattiass-MacBook-Pro Beam % opencode 2073 | }) 2074 | return result 2075 | } 2076 | 2077 | export function listen(opts: { port: number; hostname: string }) { 2078 | const server = Bun.serve({ ^ error: Failed to start server. Is port 0 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:2078:24) at server (src/cli/cmd/tui/worker.ts:34:23) at server (src/cli/cmd/tui/worker.ts:31:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24)
Author
Owner

@anntnzrb commented on GitHub (Dec 26, 2025):

This looks like corrupted state rather than an actual port conflict (errno: 0 is unusual). Try these in order:

  1. Clear opencode state directories:
rm -rf ~/Library/Application\ Support/opencode
rm -rf ~/Library/Caches/opencode
rm -rf ~/.local/state/opencode
  1. Clear Bun cache:
rm -rf ~/.bun/install/cache
  1. Reinstall opencode:
curl -fsSL https://opencode.ai/install | bash

Also check if any firewall/security software (Little Snitch, Lulu, etc.) might be blocking socket creation.

Let us know if that helps!

@anntnzrb commented on GitHub (Dec 26, 2025): This looks like corrupted state rather than an actual port conflict (errno: 0 is unusual). Try these in order: 1. **Clear opencode state directories:** ```bash rm -rf ~/Library/Application\ Support/opencode rm -rf ~/Library/Caches/opencode rm -rf ~/.local/state/opencode ``` 2. **Clear Bun cache:** ```bash rm -rf ~/.bun/install/cache ``` 3. **Reinstall opencode:** ```bash curl -fsSL https://opencode.ai/install | bash ``` Also check if any firewall/security software (Little Snitch, Lulu, etc.) might be blocking socket creation. Let us know if that helps!
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

i have tried EVERY thing that you have listed there and still i am getting the same error as before.

@mattiasmicu commented on GitHub (Dec 26, 2025): i have tried EVERY thing that you have listed there and still i am getting the same error as before.
Author
Owner

@anntnzrb commented on GitHub (Dec 26, 2025):

A few more things to check:

  1. What Bun version is bundled?
bun --version
  1. Check file permissions on opencode binary:
ls -la ~/.local/bin/opencode
ls -la ~/.opencode/bin/
  1. Test if Bun can bind to a socket at all (create a temp file and run):
echo "Bun.serve({ port: 9999, fetch: () => new Response(\"ok\") }); console.log(\"works\")" | bun run -
  1. Try running opencode with sudo (just to rule out permission issues):
sudo opencode

The errno: 0 is very unusual — it might mean Bun is misreporting an EACCES (permission denied) as EADDRINUSE.

@anntnzrb commented on GitHub (Dec 26, 2025): A few more things to check: 1. **What Bun version is bundled?** ```bash bun --version ``` 2. **Check file permissions on opencode binary:** ```bash ls -la ~/.local/bin/opencode ls -la ~/.opencode/bin/ ``` 3. **Test if Bun can bind to a socket at all** (create a temp file and run): ```bash echo "Bun.serve({ port: 9999, fetch: () => new Response(\"ok\") }); console.log(\"works\")" | bun run - ``` 4. **Try running opencode with sudo** (just to rule out permission issues): ```bash sudo opencode ``` The `errno: 0` is very unusual — it might mean Bun is misreporting an `EACCES` (permission denied) as `EADDRINUSE`.
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

Hello, thanks for the reply but i have ran all of your commands now and i will paste them bellow: mattias@Mattiass-MacBook-Pro Beam % bun --version
1.3.3
mattias@Mattiass-MacBook-Pro Beam % ls -la ~/.local/bin/opencode
ls -la ~/.opencode/bin/
ls: /Users/mattias/.local/bin/opencode: No such file or directory
total 186592
drwxr-xr-x@ 3 mattias staff 96 Dec 26 18:36 .
drwxr-xr-x@ 7 mattias staff 224 Dec 21 23:04 ..
-rwxr-xr-x@ 1 mattias staff 95534832 Dec 26 05:08 opencode
mattias@Mattiass-MacBook-Pro Beam % echo "Bun.serve({ port: 9999, fetch: () => new Response("ok") }); console.log("works")" | bun run -
works
^C
mattias@Mattiass-MacBook-Pro Beam % That command just hangs
zsh: command not found: That
mattias@Mattiass-MacBook-Pro Beam % sudo opencode
Password:
2073 | })
2074 | return result
2075 | }
2076 |
2077 | export function listen(opts: { port: number; hostname: string }) {
2078 | const server = Bun.serve({
^
error: Failed to start server. Is port 0 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:2078:24)
  at server (src/cli/cmd/tui/worker.ts:34:23)
  at server (src/cli/cmd/tui/worker.ts:31:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)

^C%
mattias@Mattiass-MacBook-Pro Beam %

@mattiasmicu commented on GitHub (Dec 26, 2025): Hello, thanks for the reply but i have ran all of your commands now and i will paste them bellow: mattias@Mattiass-MacBook-Pro Beam % bun --version 1.3.3 mattias@Mattiass-MacBook-Pro Beam % ls -la ~/.local/bin/opencode ls -la ~/.opencode/bin/ ls: /Users/mattias/.local/bin/opencode: No such file or directory total 186592 drwxr-xr-x@ 3 mattias staff 96 Dec 26 18:36 . drwxr-xr-x@ 7 mattias staff 224 Dec 21 23:04 .. -rwxr-xr-x@ 1 mattias staff 95534832 Dec 26 05:08 opencode mattias@Mattiass-MacBook-Pro Beam % echo "Bun.serve({ port: 9999, fetch: () => new Response(\"ok\") }); console.log(\"works\")" | bun run - works ^C mattias@Mattiass-MacBook-Pro Beam % That command just hangs zsh: command not found: That mattias@Mattiass-MacBook-Pro Beam % sudo opencode Password: 2073 | }) 2074 | return result 2075 | } 2076 | 2077 | export function listen(opts: { port: number; hostname: string }) { 2078 | const server = Bun.serve({ ^ error: Failed to start server. Is port 0 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:2078:24) at server (src/cli/cmd/tui/worker.ts:34:23) at server (src/cli/cmd/tui/worker.ts:31:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24) ^C% mattias@Mattiass-MacBook-Pro Beam %
Author
Owner

@anntnzrb commented on GitHub (Dec 26, 2025):

Good news: your system Bun works fine (the test printed "works"). The issue is specific to opencode's bundled runtime.

A few more diagnostics:

  1. Check exact macOS version: (you mentioned 21.1 - that doesnt exist afaik??)
sw_vers
  1. Check bundled opencode version:
~/.opencode/bin/opencode --version
  1. Try a completely clean reinstall (backup first):
mv ~/.opencode ~/.opencode.bak
curl -fsSL https://opencode.ai/install | bash
  1. Alternative: install via npm (uses system Bun instead of bundled):
npm i -g opencode-ai

If npm install works but curl doesn't, the bundled Bun binary might be incompatible with your macOS version.

@anntnzrb commented on GitHub (Dec 26, 2025): Good news: your system Bun works fine (the test printed "works"). The issue is specific to opencode's bundled runtime. A few more diagnostics: 1. **Check exact macOS version:** (you mentioned 21.1 - that doesnt exist afaik??) ```bash sw_vers ``` 2. **Check bundled opencode version:** ```bash ~/.opencode/bin/opencode --version ``` 3. **Try a completely clean reinstall** (backup first): ```bash mv ~/.opencode ~/.opencode.bak curl -fsSL https://opencode.ai/install | bash ``` 4. **Alternative: install via npm** (uses system Bun instead of bundled): ```bash npm i -g opencode-ai ``` If npm install works but curl doesn't, the bundled Bun binary might be incompatible with your macOS version.
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

ok i have ran you commands again. but macos 21.1 exists but its also called macos Tahoe.

mattias@Mattiass-MacBook-Pro Beam % sw_vers
ProductName: macOS
ProductVersion: 26.1
BuildVersion: 25B78
mattias@Mattiass-MacBook-Pro Beam % ~/.opencode/bin/opencode --version
1.0.203
mattias@Mattiass-MacBook-Pro Beam % mv ~/.opencode ~/.opencode.bak
curl -fsSL https://opencode.ai/install | bash
Installed version: .

Installing opencode version: 1.0.203
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%

█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
█░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

OpenCode includes free models, to start:

cd # Open directory
opencode # Run command

For more information visit https://opencode.ai/docs

mattias@Mattiass-MacBook-Pro Beam % npm i -g opencode-ai

changed 2 packages in 3s
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.7.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0
npm notice To update run: npm install -g npm@11.7.0
npm notice
mattias@Mattiass-MacBook-Pro Beam % opencode
2073 | })
2074 | return result
2075 | }
2076 |
2077 | export function listen(opts: { port: number; hostname: string }) {
2078 | const server = Bun.serve({
^
error: Failed to start server. Is port 0 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:2078:24)
  at server (src/cli/cmd/tui/worker.ts:34:23)
  at server (src/cli/cmd/tui/worker.ts:31:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)

^C%
mattias@Mattiass-MacBook-Pro Beam %

@mattiasmicu commented on GitHub (Dec 26, 2025): ok i have ran you commands again. but macos 21.1 exists but its also called macos Tahoe. mattias@Mattiass-MacBook-Pro Beam % sw_vers ProductName: macOS ProductVersion: 26.1 BuildVersion: 25B78 mattias@Mattiass-MacBook-Pro Beam % ~/.opencode/bin/opencode --version 1.0.203 mattias@Mattiass-MacBook-Pro Beam % mv ~/.opencode ~/.opencode.bak curl -fsSL https://opencode.ai/install | bash Installed version: . Installing opencode version: 1.0.203 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% ▄ █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█ █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ OpenCode includes free models, to start: cd <project> # Open directory opencode # Run command For more information visit https://opencode.ai/docs mattias@Mattiass-MacBook-Pro Beam % npm i -g opencode-ai changed 2 packages in 3s npm notice npm notice New major version of npm available! 10.8.2 -> 11.7.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0 npm notice To update run: npm install -g npm@11.7.0 npm notice mattias@Mattiass-MacBook-Pro Beam % opencode 2073 | }) 2074 | return result 2075 | } 2076 | 2077 | export function listen(opts: { port: number; hostname: string }) { 2078 | const server = Bun.serve({ ^ error: Failed to start server. Is port 0 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:2078:24) at server (src/cli/cmd/tui/worker.ts:34:23) at server (src/cli/cmd/tui/worker.ts:31:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24) ^C% mattias@Mattiass-MacBook-Pro Beam %
Author
Owner

@anntnzrb commented on GitHub (Dec 26, 2025):

Since system Bun works but opencode fails, let's see what's happening on your system:

  1. Check listening ports:
netstat -an | grep LISTEN
  1. Check file descriptor limits:
ulimit -n
  1. Check for zombie opencode processes:
ps aux | grep -i opencode
  1. Try the spawn command directly:
~/.opencode/bin/opencode spawn --port 9999

Also — do you have any VPN, antivirus, or security software running (Cisco AnyConnect, Little Snitch, etc.)?

@anntnzrb commented on GitHub (Dec 26, 2025): Since system Bun works but opencode fails, let's see what's happening on your system: 1. **Check listening ports:** ```bash netstat -an | grep LISTEN ``` 2. **Check file descriptor limits:** ```bash ulimit -n ``` 3. **Check for zombie opencode processes:** ```bash ps aux | grep -i opencode ``` 4. **Try the spawn command directly:** ```bash ~/.opencode/bin/opencode spawn --port 9999 ``` Also — do you have any VPN, antivirus, or security software running (Cisco AnyConnect, Little Snitch, etc.)?
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

Sorry for the wait i was away but here it is: mattias@Mattiass-MacBook-Pro Beam % netstat -an | grep LISTEN
tcp6 0 0 *.54907 . LISTEN
tcp4 0 0 *.54907 . LISTEN
tcp46 0 0 *.58987 . LISTEN
tcp46 0 0 *.3283 . LISTEN
tcp6 0 0 *.5000 . LISTEN
tcp4 0 0 *.5000 . LISTEN
tcp6 0 0 *.7000 . LISTEN
tcp4 0 0 *.7000 . LISTEN
tcp46 0 0 *.58986 . LISTEN
tcp4 0 0 *.88 . LISTEN
tcp6 0 0 *.88 . LISTEN
tcp6 0 0 ::1.8021 . LISTEN
tcp4 0 0 *.5900 . LISTEN
tcp6 0 0 *.5900 . LISTEN
tcp4 0 0 *.22 . LISTEN
tcp6 0 0 *.22 . LISTEN
mattias@Mattiass-MacBook-Pro Beam % ulimit -n
1048575
mattias@Mattiass-MacBook-Pro Beam % ps aux | grep -i opencode
mattias 56543 0.0 0.0 435300064 1296 s001 S+ 7:34PM 0:00.00 grep -i opencode
mattias@Mattiass-MacBook-Pro Beam % ~/.opencode/bin/opencode spawn --port 9999
Error: Unexpected error, check log file at /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log for more details

error: Failed to start server. Is port 9999 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at serve (unknown:1:1)
  at src/cli/cmd/tui/spawn.ts:27:27
  at handler (src/cli/cmd/tui/spawn.ts:25:19)
  at ../../node_modules/.bun/yargs@18.0.0/node_modules/yargs/build/lib/command.js:245:54
  at processTicksAndRejections (native:7:39)

mattias@Mattiass-MacBook-Pro Beam %

@mattiasmicu commented on GitHub (Dec 26, 2025): Sorry for the wait i was away but here it is: mattias@Mattiass-MacBook-Pro Beam % netstat -an | grep LISTEN tcp6 0 0 *.54907 *.* LISTEN tcp4 0 0 *.54907 *.* LISTEN tcp46 0 0 *.58987 *.* LISTEN tcp46 0 0 *.3283 *.* LISTEN tcp6 0 0 *.5000 *.* LISTEN tcp4 0 0 *.5000 *.* LISTEN tcp6 0 0 *.7000 *.* LISTEN tcp4 0 0 *.7000 *.* LISTEN tcp46 0 0 *.58986 *.* LISTEN tcp4 0 0 *.88 *.* LISTEN tcp6 0 0 *.88 *.* LISTEN tcp6 0 0 ::1.8021 *.* LISTEN tcp4 0 0 *.5900 *.* LISTEN tcp6 0 0 *.5900 *.* LISTEN tcp4 0 0 *.22 *.* LISTEN tcp6 0 0 *.22 *.* LISTEN mattias@Mattiass-MacBook-Pro Beam % ulimit -n 1048575 mattias@Mattiass-MacBook-Pro Beam % ps aux | grep -i opencode mattias 56543 0.0 0.0 435300064 1296 s001 S+ 7:34PM 0:00.00 grep -i opencode mattias@Mattiass-MacBook-Pro Beam % ~/.opencode/bin/opencode spawn --port 9999 Error: Unexpected error, check log file at /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log for more details error: Failed to start server. Is port 9999 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at serve (unknown:1:1) at src/cli/cmd/tui/spawn.ts:27:27 at handler (src/cli/cmd/tui/spawn.ts:25:19) at ../../node_modules/.bun/yargs@18.0.0/node_modules/yargs/build/lib/command.js:245:54 at processTicksAndRejections (native:7:39) mattias@Mattiass-MacBook-Pro Beam %
Author
Owner

@anntnzrb commented on GitHub (Dec 26, 2025):

The error is happening inside Bun's native serve function (at serve (unknown:1:1)), not opencode itself. Port 9999 isn't in use, so this looks like a Bun bug on macOS 26.

Can you:

  1. Share the log file contents:
cat /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log
  1. Try upgrading Bun:
bun upgrade
  1. Then retry opencode:
opencode
@anntnzrb commented on GitHub (Dec 26, 2025): The error is happening inside Bun's native `serve` function (`at serve (unknown:1:1)`), not opencode itself. Port 9999 isn't in use, so this looks like a Bun bug on macOS 26. Can you: 1. **Share the log file contents:** ```bash cat /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log ``` 2. **Try upgrading Bun:** ```bash bun upgrade ``` 3. **Then retry opencode:** ```bash opencode ```
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

Ok. But something is weird cause it worked before but just not now: mattias@Mattiass-MacBook-Pro Beam % cat /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log
INFO 2025-12-26T18:35:00 +630ms service=default version=1.0.203 args=["spawn","--port","9999"] opencode
INFO 2025-12-26T18:35:00 +0ms service=config path=/Users/mattias/.config/opencode/config.json loading
ERROR 2025-12-26T18:35:00 +8ms service=default name=Error message=Failed to start server. Is port 9999 in use? stack=Error: Failed to start server. Is port 9999 in use?
at serve (unknown)
at (src/cli/cmd/tui/spawn.ts:27:27)
at handler (src/cli/cmd/tui/spawn.ts:25:19)
at (../../node_modules/.bun/yargs@18.0.0/node_modules/yargs/build/lib/command.js:245:54)
at processTicksAndRejections (native:7:39) fatal
mattias@Mattiass-MacBook-Pro Beam % bun upgrade
Bun v1.3.5 is out! You're on v1.3.3
[2.43s] Upgraded.

Welcome to Bun v1.3.5!

What's new in Bun v1.3.5:

https://bun.com/blog/release-notes/bun-v1.3.5

Report any bugs:

https://github.com/oven-sh/bun/issues

Commit log:

https://github.com/oven-sh/bun/compare/bun-v1.3.3...bun-v1.3.5

mattias@Mattiass-MacBook-Pro Beam % opencode
2073 | })
2074 | return result
2075 | }
2076 |
2077 | export function listen(opts: { port: number; hostname: string }) {
2078 | const server = Bun.serve({
^
error: Failed to start server. Is port 0 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"

  at listen (src/server/server.ts:2078:24)
  at server (src/cli/cmd/tui/worker.ts:34:23)
  at server (src/cli/cmd/tui/worker.ts:31:16)
  at <anonymous> (src/util/rpc.ts:10:41)
  at onmessage (src/util/rpc.ts:7:24)

^C%
mattias@Mattiass-MacBook-Pro Beam %

@mattiasmicu commented on GitHub (Dec 26, 2025): Ok. But something is weird cause it worked before but just not now: mattias@Mattiass-MacBook-Pro Beam % cat /Users/mattias/.local/share/opencode/log/2025-12-26T183500.log INFO 2025-12-26T18:35:00 +630ms service=default version=1.0.203 args=["spawn","--port","9999"] opencode INFO 2025-12-26T18:35:00 +0ms service=config path=/Users/mattias/.config/opencode/config.json loading ERROR 2025-12-26T18:35:00 +8ms service=default name=Error message=Failed to start server. Is port 9999 in use? stack=Error: Failed to start server. Is port 9999 in use? at serve (unknown) at <anonymous> (src/cli/cmd/tui/spawn.ts:27:27) at handler (src/cli/cmd/tui/spawn.ts:25:19) at <anonymous> (../../node_modules/.bun/yargs@18.0.0/node_modules/yargs/build/lib/command.js:245:54) at processTicksAndRejections (native:7:39) fatal mattias@Mattiass-MacBook-Pro Beam % bun upgrade Bun v1.3.5 is out! You're on v1.3.3 [2.43s] Upgraded. Welcome to Bun v1.3.5! What's new in Bun v1.3.5: https://bun.com/blog/release-notes/bun-v1.3.5 Report any bugs: https://github.com/oven-sh/bun/issues Commit log: https://github.com/oven-sh/bun/compare/bun-v1.3.3...bun-v1.3.5 mattias@Mattiass-MacBook-Pro Beam % opencode 2073 | }) 2074 | return result 2075 | } 2076 | 2077 | export function listen(opts: { port: number; hostname: string }) { 2078 | const server = Bun.serve({ ^ error: Failed to start server. Is port 0 in use? syscall: "listen", errno: 0, code: "EADDRINUSE" at listen (src/server/server.ts:2078:24) at server (src/cli/cmd/tui/worker.ts:34:23) at server (src/cli/cmd/tui/worker.ts:31:16) at <anonymous> (src/util/rpc.ts:10:41) at onmessage (src/util/rpc.ts:7:24) ^C% mattias@Mattiass-MacBook-Pro Beam %
Author
Owner

@rekram1-node commented on GitHub (Dec 26, 2025):

btw your local bun version shoudl have nothing to do w/ opencode, opencode has bun built into it so unless u are messing w/ bun env vars or special configs u shouldnt need to run bun upgrade ever (or even have it installed!)

@rekram1-node commented on GitHub (Dec 26, 2025): btw your local bun version shoudl have nothing to do w/ opencode, opencode has bun built into it so unless u are messing w/ bun env vars or special configs u shouldnt need to run bun upgrade ever (or even have it installed!)
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

then what do i do?

@mattiasmicu commented on GitHub (Dec 26, 2025): then what do i do?
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

and i have not messed with anything

@mattiasmicu commented on GitHub (Dec 26, 2025): and i have not messed with anything
Author
Owner

@mattiasmicu commented on GitHub (Dec 26, 2025):

I have found a fix. I had do update my device from 21.1 to 21.2. But thanks for helping!

@mattiasmicu commented on GitHub (Dec 26, 2025): I have found a fix. I had do update my device from 21.1 to 21.2. But thanks for helping!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3890