Failed to start server on port 4096 #8475

Open
opened 2026-02-16 18:10:04 -05:00 by yindo · 1 comment
Owner

Originally created by @BowieHe on GitHub (Feb 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

when I tried to run the server according to Wiki with command

OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096

it returns following error, and log contains something, but nothing useful

➜  code OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096
Error: Unexpected error, check log file at /home/bowie/.local/share/opencode/log/2026-02-04T033731.log for more details

Failed to start server on port 4096
➜  code /home/bowie/.local/share/opencode/log/2026-02-04T033731.log
zsh: permission denied: /home/bowie/.local/share/opencode/log/2026-02-04T033731.log
➜  code cat /home/bowie/.local/share/opencode/log/2026-02-04T033731.log                                                 INFO  2026-02-04T03:37:31 +223ms service=default version=1.1.50 args=["serve","--hostname","0.0.0.0","--port","4096"] opencode
INFO  2026-02-04T03:37:31 +0ms service=config path=/home/bowie/.config/opencode/config.json loading
INFO  2026-02-04T03:37:31 +2ms service=config path=/home/bowie/.config/opencode/opencode.json loading
INFO  2026-02-04T03:37:31 +1ms service=config path=/home/bowie/.config/opencode/opencode.jsonc loading
ERROR 2026-02-04T03:37:31 +25ms service=default name=Error message=Failed to start server on port 4096 stack=Error: Failed to start server on port 4096
    at listen (src/server/server.ts:589:28)
    at <anonymous> (src/cli/cmd/serve.ts:15:27)
    at processTicksAndRejections (native:7:39) fatal

But if I run it in another user with set HOME=test_home.
this command works.

And I also tried to downgrade to 1.49, it shows the same issue

And I also tried to install in bash, npm way, the issue still remains.

all the properties and related files has been deleted. does this has some relationship with OpenCode Desktop in Windows? because all this happens after I update the OpenCode Desktop in windows to 1.50

Plugins

None

OpenCode version

1.50

Steps to reproduce

1, run the command in WSL OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096

Screenshot and/or share link

No response

Operating System

Windows 11, WSL Ubuntu

Terminal

Windows terminal

Originally created by @BowieHe on GitHub (Feb 3, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description when I tried to run the server according to Wiki with command OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096 it returns following error, and log contains something, but nothing useful ``` ➜ code OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096 Error: Unexpected error, check log file at /home/bowie/.local/share/opencode/log/2026-02-04T033731.log for more details Failed to start server on port 4096 ➜ code /home/bowie/.local/share/opencode/log/2026-02-04T033731.log zsh: permission denied: /home/bowie/.local/share/opencode/log/2026-02-04T033731.log ➜ code cat /home/bowie/.local/share/opencode/log/2026-02-04T033731.log INFO 2026-02-04T03:37:31 +223ms service=default version=1.1.50 args=["serve","--hostname","0.0.0.0","--port","4096"] opencode INFO 2026-02-04T03:37:31 +0ms service=config path=/home/bowie/.config/opencode/config.json loading INFO 2026-02-04T03:37:31 +2ms service=config path=/home/bowie/.config/opencode/opencode.json loading INFO 2026-02-04T03:37:31 +1ms service=config path=/home/bowie/.config/opencode/opencode.jsonc loading ERROR 2026-02-04T03:37:31 +25ms service=default name=Error message=Failed to start server on port 4096 stack=Error: Failed to start server on port 4096 at listen (src/server/server.ts:589:28) at <anonymous> (src/cli/cmd/serve.ts:15:27) at processTicksAndRejections (native:7:39) fatal ``` But if I run it in another user with set HOME=test_home. this command works. And I also tried to downgrade to 1.49, it shows the same issue And I also tried to install in bash, npm way, the issue still remains. all the properties and related files has been deleted. does this has some relationship with OpenCode Desktop in Windows? because all this happens after I update the OpenCode Desktop in windows to 1.50 ### Plugins None ### OpenCode version 1.50 ### Steps to reproduce 1, run the command in WSL `OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 --port 4096` ### Screenshot and/or share link _No response_ ### Operating System Windows 11, WSL Ubuntu ### Terminal Windows terminal
yindo added the windowsbug labels 2026-02-16 18:10:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9859: Windows: Ghost port bindings when server killed via SIGTERM - covers the port binding issue when server fails to shutdown gracefully
  • #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use - covers the scenario where multiple OpenCode instances try to use the same port

Given that the issue mentions the error "Failed to start server on port 4096" and occurs after updating OpenCode Desktop in Windows, it may be related to either ghost port bindings from improper shutdown or conflicts with an existing server instance.

Feel free to ignore if your specific case is different from these issues.

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #9859: Windows: Ghost port bindings when server killed via SIGTERM - covers the port binding issue when server fails to shutdown gracefully - #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use - covers the scenario where multiple OpenCode instances try to use the same port Given that the issue mentions the error "Failed to start server on port 4096" and occurs after updating OpenCode Desktop in Windows, it may be related to either ghost port bindings from improper shutdown or conflicts with an existing server instance. Feel free to ignore if your specific case is different from these issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8475