Devidian / docker-spaceengineers

A Docker for Space Engineers Dedicated Server
87 stars 21 forks source link

server crashes and restarts when client connects #66

Open Lenn1K opened 1 month ago

Lenn1K commented 1 month ago

it seems like the server crashes and restarts when a client connects. i can see the request in the console but around 15-20 seconds after, the server logs indicate a restart. the server instance works fine if started from the dedicated server tool. did anyone else experience something similar? any help is much appreciated!

m4gicfour commented 1 month ago

So I just had this happen on UNRAID;

ls: cannot access '/appdata/space-engineers/plugins/*.dll': No such file or directory
Setting breakpad minidump AppID = 244850
2024-07-15 23:15:12.913: OnConnectedClient Mr Ouch attempt
2024-07-15 23:15:13.074: Server ValidateAuthTicketResponse (OK), Steam ID:[...] Owner ID:[...]
2024-07-15 23:15:31.644: World request received: Mr Ouch
2024-07-15 23:15:46.784: Loaded 506 Steam Inventory item definitions
2024-07-15 23:20:45.112: User left Mr Ouch
2024-07-15 23:20:45.138: Disconnected: [...]
2024-07-15 23:21:10.775: OnConnectedClient Mr Ouch attempt
2024-07-15 23:21:10.987: Server ValidateAuthTicketResponse (OK), Steam ID:[...] Owner ID:[...]
2024-07-15 23:21:18.937: World request received: Mr Ouch
2024-07-15 23:22:46.580: User left Mr Ouch
2024-07-15 23:22:46.584: Disconnected: [...]
2024-07-15 23:23:30.408: Peer2Peer_ConnectionFailed [...], Timeout
2024-07-15 23:23:30.424: User left [...]
2024-07-15 23:30:13.752: Peer2Peer_SessionRequest [...]
2024-07-15 23:30:17.222: OnConnectedClient Mr Ouch attempt
2024-07-15 23:30:17.451: Server ValidateAuthTicketResponse (OK), Steam ID:[...] Owner ID:[...]
2024-07-15 23:30:21.101: World request received: Mr Ouch
-----------------------------------END GAME----------------------------------
-----------------------------------BYE !!!!----------------------------------
-------------------------------INSTALL & UPDATE------------------------------
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/.local/share/Steam/logs/stderr.txt'
Logging directory: '/root/.local/share/Steam/logs'
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1718904263
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
"@sSteamCmdForcePlatformType" = "windows"
Success! App '298740' already up to date.
---------------------------------UPDATE CONFIG-------------------------------
---------------------------------UPDATE PLUGINS------------------------------
Found 0 plugins in /appdata/space-engineers/plugins
-----------------------------CURRENT CONFIGURATION---------------------------
GAME_DIR=/appdata/space-engineers/SpaceEngineersDedicated
CONFIG_PATH=/appdata/space-engineers/instances/seds/SpaceEngineers-Dedicated.cfg
INSTANCE_IP=172.17.0.27
CURRENT_IP=172.17.0.27
CURRENT_WORLDNAME=Star System
SAVE_PATH=Z:\\appdata\\space-engineers\\instances\\seds\\Saves\\Star System
wine-9.0
----------------------------------START GAME---------------------------------
2024-07-15 23:30:50.151: App Version: 01_204_018
2024-07-15 23:30:50.181: Is official: True [NO][NIS][NAMP]
2024-07-15 23:30:50.183: Client Build Number: 0
2024-07-15 23:30:50.183: Server Build Number: 0
2024-07-15 23:30:50.184: Environment.ProcessorCount: 40
2024-07-15 23:30:50.186: Environment.OSVersion: Microsoft Windows 7 Professional (Microsoft Windows NT 6.1.7601 Service Pack 1)
2024-07-15 23:30:50.186: Environment.CommandLine: "Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64\SpaceEngineersDedicated.exe" -noconsole -ignorelastsession -path Z:\appdata\space-engineers\instances\seds
2024-07-15 23:30:50.186: Environment.Is64BitProcess: True
2024-07-15 23:30:50.186: Environment.Is64BitOperatingSystem: True
2024-07-15 23:30:50.187: Environment.Version: .NET Framework 4.8.3761.0
2024-07-15 23:30:50.187: Environment.CurrentDirectory: Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64
2024-07-15 23:30:50.187: CPU Info:       Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz
2024-07-15 23:30:53.742: Bind IP : 172.17.0.27:27016
2024-07-15 23:31:01.233: Networking service: Steam
2024-07-15 23:31:01.233: Server successfully started
2024-07-15 23:31:01.233: Product name: Space Engineers
2024-07-15 23:31:01.234: Desc: Space Engineers
2024-07-15 23:31:01.234: Public IP: [XXX]
2024-07-15 23:31:01.235: User ID: [...]
2024-07-15 23:31:01.241: Server connected to Steam
2024-07-15 23:31:03.285: Server Name: [XXX]
2024-07-15 23:31:03.286: World Name: Star System
2024-07-15 23:31:03.412: Remote Server Listener started. Listening on port 8080
2024-07-15 23:31:03.925: Auto Restart Enabled
2024-07-15 23:31:12.576: Loading Sandbox world configuration file Z:\appdata\space-engineers\instances\seds\Saves\Star System\Sandbox_config.sbc
2024-07-15 23:31:12.647: Sandbox world configuration file found, overriding checkpoint settings.
2024-07-15 23:31:12.659: Server PolicyResponse (1)
2024-07-15 23:31:12.665: Downloading world mods - START
2024-07-15 23:31:13.427: Up to date mod: Id = 2498370001, title = 'Gear Blocks'
2024-07-15 23:31:13.429: Up to date mod: Id = 2267007067, title = '[QoL] Mechanical Keybinds'
2024-07-15 23:31:13.432: Up to date mod: Id = 2229713368, title = 'Airtight Gate'
2024-07-15 23:31:13.433: Up to date mod: Id = 1379837654, title = 'MA Fighter Gunner Cockpit'
2024-07-15 23:31:13.436: Up to date mod: Id = 1372153381, title = '[Fixed] rearth's Advanced Combat Systems'
2024-07-15 23:31:13.437: Up to date mod: Id = 1359954841, title = 'Rotary Airlock'
2024-07-15 23:31:13.439: Up to date mod: Id = 484504816, title = 'Energy Shields'
2024-07-15 23:31:13.441: Mod download time: 0.02 seconds
2024-07-15 23:31:13.444: Downloading world mods - END
2024-07-15 23:31:13.471: Loading session: Z:\appdata\space-engineers\instances\seds\Saves\Star System
2024-07-15 23:31:13.641: Experimental mode: Yes
2024-07-15 23:31:13.642: Experimental mode reason: ExperimentalMode, EnableIngameScripts, Mods, SupergriddingEnabled
2024-07-15 23:31:13.642: Console compatibility: No
2024-07-15 23:31:15.174: Peer2Peer_SessionRequest [...]
2024-07-15 23:32:32.500: Analytics session started: UserID = (-) SessionID = (-)
2024-07-15 23:32:32.564: Session loaded
2024-07-15 23:32:32.867: OnConnectedClient Mr Ouch attempt
2024-07-15 23:32:39.323: Server ValidateAuthTicketResponse (OK), Steam ID:[...] Owner ID:[...]
2024-07-15 23:32:41.037: Game ready... 
2024-07-15 23:32:44.939: World request received: Mr Ouch
2024-07-15 23:32:59.865: Loaded 506 Steam Inventory item definitions
2024-07-15 23:47:33.073: User left Mr Ouch
2024-07-15 23:47:33.109: Disconnected: [...]
2024-07-15 23:47:43.163: OnConnectedClient Mr Ouch attempt
2024-07-15 23:47:43.360: Server ValidateAuthTicketResponse (OK), Steam ID:[...] Owner ID:[...]
2024-07-15 23:47:49.210: World request received: Mr Ouch
2024-07-15 23:49:15.405: User left Mr Ouch
2024-07-15 23:49:15.406: Disconnected: [...]
2024-07-15 23:50:08.173: Peer2Peer_ConnectionFailed [...], Timeout
2024-07-15 23:50:08.186: User left [...]

I was having problems connecting to my WAN ip (ended up being a port forwarding issue; UDP was forwarded but TCP wasn't). I joined and left several times to make sure that it was actually connecting properly every time and not just a fluke, and on one attempt the server just bailed out without any error.

The docker entrypoint script did its thing, checking for updates via steamcmd and then relaunching the server, after which I had several successful connection attempts without any further issue. No idea why, and the log is unlikely to be any help honestly.

I did notice the docker health check staying on "starting" for ~10 minutes then switching to "unhealthy"

root@unraid:~# docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                      PORTS                                                                                                                                                          NAMES
2f889e62a2a9   devidian/spaceengineers        "/bin/sh -c /root/en…"   46 minutes ago   Up 28 minutes (unhealthy)   0.0.0.0:18080->18080/tcp, :::18080->18080/tcp, 0.0.0.0:27016->27016/tcp, :::27016->27016/tcp, 0.0.0.0:27016->27016/udp, :::27016->27016/udp                    SpaceEngineers

I'm not super familiar with how docker's healthcheck works; is there anything in docker itself or this docker specifically that kills and restarts the DS after a specific amount of time without a healthy result (and any idea why it's indicating unhealthy?)

Finally, it's offtopic but being that there's no access to the GUI config tool, is there a way to cause the server to save and gracefully shutdown? Will it do so upon stopping the docker?