-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
When a user runs the multiplayer
command to enable multiplayer mode, it creates a persistent job that automatically restarts when the server starts. However, when subsequently running sliver-server daemon
, the daemon fails to start because both the persistent multiplayer job and the daemon attempt to bind to the same port (31337 by default), resulting in a "bind: address already in use" error.
To Reproduce
- Use the latest version from master available as of 2025/08/10 and compile the server
- Start the sliver server normally:
./sliver-server
- Enable multiplayer mode:
multiplayer
- Exit the server:
exit
- Try to start the server in daemon mode:
./sliver-server daemon
. The same applies if the daemon is started through the config file in.sliver/config/server.json
enabling"daemon_mode": true
- See error:
[!] Failed to start daemon listen tcp :31337: bind: address already in use
Expected behavior
The sliver-server daemon
command should start successfully without port conflicts. The daemon should either skip conflicting persistent multiplayer jobs or use the existing multiplayer listener to serve the same purpose.
Screenshots
./sliver-server
██████ ██▓ ██▓ ██▒ █▓▓█████ ██▀███
▒██ ▒ ▓██▒ ▓██▒▓██░ █▒▓█ ▀ ▓██ ▒ ██▒
░ ▓██▄ ▒██░ ▒██▒ ▓██ █▒░▒███ ▓██ ░▄█ ▒
▒ ██▒▒██░ ░██░ ▒██ █░░▒▓█ ▄ ▒██▀▀█▄
▒██████▒▒░██████▒░██░ ▒▀█░ ░▒████▒░██▓ ▒██▒
▒ ▒▓▒ ▒ ░░ ▒░▓ ░░▓ ░ ▐░ ░░ ▒░ ░░ ▒▓ ░▒▓░
░ ░▒ ░ ░░ ░ ▒ ░ ▒ ░ ░ ░░ ░ ░ ░ ░▒ ░ ▒░
░ ░ ░ ░ ░ ▒ ░ ░░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░
All hackers gain improvise
[*] Server v0.0.0 - c6bbba16e15abc8a044c62f2cd4a4bbdbbe459e1 - Dirty
[*] Welcome to the sliver shell, please type 'help' for options
sliver > jobs
ID Name Protocol Port Domains
==== ====== ========== ====== =========
1 mtls tcp 8443
sliver > multiplayer
[*] Multiplayer mode enabled!
sliver > jobs
ID Name Protocol Port Domains
==== =========== ========== ======= =========
1 mtls tcp 8443
2 grpc/mtls tcp 31337
sliver > exit
Exiting...
f785616ee887:/app$ ./sliver-server daemon
[!] Failed to start daemon listen tcp :31337: bind: address already in use
f785616ee887:/app$
Desktop (please complete the following information):
- OS: Debian
- Version: 12
Additional context
The issue occurs because:
- The
multiplayer
command saves a persistent job to the database that binds to port 31337 - When
sliver-server daemon
starts, it first attempts to restart all persistent jobs (including the multiplayer job) - The daemon job tries to bind to port 31337 and fails because the multiplayer already has a bind on the same port
- This causes the daemon startup to fail with a port binding error
Both the multiplayer listener and daemon serve the same purpose (allowing operators to connect via mTLS), so having both running simultaneously is redundant and causes this conflict.