anomalyco / anomalyco/opencode
OpenCode fails when two hosts share an NFS home directory
@kitlangton is already working on this.
Since Aug 20, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
OpenCode 1.18.19 cannot be used concurrently from two separate Linux hosts when both hosts use the same NFS-mounted home directory.
OpenCode works normally when used:
- On one host only; or
- From the same host, including with different OpenCode modes.
However, whenever OpenCode is running from one host, starting OpenCode from a second host using the same shared home directory fails, regardless of the selected mode or port.
Observed behavior:
- Starting
opencode webon one host and then startingopencodeon another host causes the second OpenCode instance to hang with a black screen. - Starting
opencode webfrom the second host fails with eitherServeError,Unexpected error, orLocking protocol. - The black screen remains indefinitely.
- Disconnecting the SSH session and starting a new session makes OpenCode usable again (assuming there is no OpenCode running on another host).
- The issue also occurs with a fresh and empty project directory, so it does not appear to depend on project-specific state.
- Using different ports does not resolve the issue.
- Using different combinations of TUI and web mode does not resolve the issue.
The hosts share an NFS-mounted home directory. The issue appears to be caused by host-independent locking or state files stored below the shared home directory.
Plugins
No response
OpenCode version
1.18.19
Steps to reproduce
Environment
- Two separate Linux hosts
- Ubuntu 24.04.4 LTS on both hosts
- NFS-mounted shared home directory
- Fish and/or Bash shells
- OpenCode 1.18.19
Reproduction
-
Log in to host A using the shared NFS home directory.
-
Start OpenCode, for example:
npx -y opencode-ai@latest web \ --port 8080 \ --hostname <HOSTNAME> -
Leave OpenCode running.
-
Log in to host B using the same shared NFS home directory.
-
Start OpenCode:
opencode -
Observe that the second instance hangs indefinitely with a black screen.
Alternatively:
-
Start
opencode web(or justopencode) on host A. -
Start
opencode webon host B, using either the same or a different port. -
Observe an error similar to:
! OPENCODE_SERVER_PASSWORD is not set; server is unsecured. Error: Unexpected error ServeErrorIn some cases:
Locking protocol
The same problem occurs when using different combinations of TUI and web mode. Changing the port does not resolve the issue.
Expected behavior
OpenCode should either:
- Support concurrent use from separate hosts sharing an NFS home directory; or
- Clearly document that a shared home directory is unsupported; or
- Use host-specific runtime and lock files so that separate hosts do not interfere with each other; or
- Fail with a clear error identifying the conflicting lock/state file and how to recover.
Actual behavior
- The second OpenCode instance hangs indefinitely with a black screen.
opencode webmay fail withServeError,Unexpected error, orLocking protocol.- The failure occurs even with different ports and different OpenCode modes.
- The problem occurs with a fresh and empty project.
- Disconnecting the hanging SSH session allows OpenCode to work again in a subsequent SSH session.
Screenshot and/or share link
Operating System
Ubuntu 24.04.4 LTS
Terminal
fish, bash
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.