Repository navigation
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: not applicable (code-server does not serve requests)
- Local OS: not applicable
- Remote OS: Ubuntu 24.04 and Rocky Linux 9
- Remote Architecture: arm64 (Ubuntu) and amd64 (Rocky)
code-server --version: 4.134.0 and 4.143.1
Steps to Reproduce
- Install code-server 4.134.0 or later.
- Run
systemd-socket-activate -l 127.0.0.1:18190 code-server --socket-fd 3 --auth none. This passes a listening TCP socket as fd 3, as systemd socket activation does. - Run
curl http://127.0.0.1:18190/healthz. - Repeat with a Unix socket:
systemd-socket-activate -l /tmp/cs.sock code-server --socket-fd 3 --auth none, thencurl --unix-socket /tmp/cs.sock http://localhost/healthz.
Expected
code-server listens on the inherited socket and answers the request.
Actual
code-server logs error listen EEXIST: file already exists and does not serve requests. This occurs for TCP and Unix sockets.
Logs
[2026-10-27T19:17:11.391Z] info code-server 4.143.1 22ddf60dbc52f164cff13620ab515086dd08c90a
[2026-10-27T19:17:11.392Z] info Using user-data-dir /root/.local/share/code-server
[2026-10-27T19:17:11.393Z] error listen EEXIST: file already exists
Does this bug reproduce in native VS Code?
No, this works as expected in native VS Code
Does this bug reproduce in VS Code web?
No, this works as expected in VS Code web
Does this bug reproduce in GitHub Codespaces?
No, this works as expected in GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
#7940 added --socket-fd. The flag fails for two reasons:
- The parent process gets the socket, but the child process calls
listen.ParentProcess.spawninsrc/node/wrapper.tsforks the child withstdio: ["pipe", "pipe", "pipe", "ipc"], so the child does not inherit the socket. In the child, fd 3 is the IPC channel, solisten({ fd: 3 })fails withEEXIST. - A second failure occurs when the child gets a Unix socket by fd.
server.address()then returnsnull, andensureAddressinsrc/node/app.tsthrowsServer has no address. TCP sockets are not affected.
The unit test in #7940 calls listen() in the test process, so the test does not go through the wrapper. --socket-fd is a code-server flag, so the VS Code answers above do not apply. I will open a PR that fixes both failures.
Metadata
Metadata
Assignees
Labels
No labels
Activity
linear-code commentedon Oct 27, 2026
CODE-92