lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 271 forks source link

Server crashes on connect with missing cert error #102

Closed trevorloflin closed 3 years ago

trevorloflin commented 3 years ago

We just updated to the latest version of Valheim and now the server crashes every time we try to connect with the following error (in the logs):

valheim | src/steamnetworkingsockets/clientlib/steamnetworkingsockets_p2p.cpp (338) : Assertion Failed: GetState() == k_ESteamNetworkingConnectionState_ProblemDetectedLocally valheim | src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp (2473) : Assertion Failed: [#4142063336 P2P steamid:76561197984411869] problem (5002) We don't have cert, and self-signed certs not allowed, but connection already dead (0 5002 We don't have cert, and self-signed certs not allowed)

We're running the docker image within an Azure VM.

lloesche commented 3 years ago

I just tried to reproduce but can't. Started a fresh container, it starts up and downloads with

...
 Update state (0x61) downloading, progress: 99.20 (1042903867 / 1051292475)
Success! App '896660' fully installed.

server starts with

...
02/26/2021 09:24:36:  Done generating locations, duration:28941.649 ms
02/26/2021 09:24:36: DungeonDB Start 506

and when I connect I get

02/26/2021 11:17:02: Connecting to Steamworks.SteamNetworkingIdentity
02/26/2021 11:17:02: Got status changed msg k_ESteamNetworkingConnectionState_FindingRoute
...
02/26/2021 11:17:04: Got handshake from client 76561197987220805
...
02/26/2021 11:17:08: VERSION check their:0.146.11  mine:0.146.11
02/26/2021 11:17:08: Server: New peer connected,sending global keys
...
02/26/2021 11:17:21: Got character ZDOID from Luu : 724918021:1

and the client loads into the world.

Maybe some intermittent issue?

The error is produced in CSteamNetworkConnectionBase::BRecvCryptoHandshake specifically https://github.com/ValveSoftware/GameNetworkingSockets/blob/8b678e4f6721d5ac3105e5b53fc9aa9c4089856e/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp#L1559-L1577 If the issue persists and you're inclined to debug it further that's where I'd start tracing back the cause.

lloesche commented 3 years ago

A new version of Valheim was released today and the changelog lists

* Fixes instant disconnection issue that some players have experienced.

@trevorloflin can you check if the update fixes your connection issue?

trevorloflin commented 3 years ago

It looks initially like I'm still getting the same error. I'm going to dig deeper and see if I can get you more info.

SpiderKraken commented 3 years ago

seems i posted a possible linked issue?

src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp (1276) : Assertion Failed: SDR service thread gave up on lock after waiting 55ms. This directly adds to delay of processing of network packets! stdout

even with a fresh install on the server same issue.

trevorloflin commented 3 years ago

Here are the logs of the server starting up:

2021-02-26 09:41:16,422 INFO spawned: 'valheim-server' with pid 490
Running Valheim Server
ERROR: ld.so: object 'libdoorstop_x64.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Found path: /opt/valheim/plus/valheim_server.x86_64
Mono path[0] = '/opt/valheim/plus/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/plus/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Initialize engine version: 2019.4.20f1 (6dd1c08eedfa)
[Subsystems] Discovering subsystems at path /opt/valheim/plus/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  0.057 seconds
2021-02-26 09:41:17,526 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim-server: started
UnloadTime: 0.925900 ms
02/26/2021 09:41:18: Starting to load scene:start
HDR Render Texture not supported, disabling HDR on reflection probe.
HDR Render Texture not supported, disabling HDR on reflection probe.
Unloading 6 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 4.615800 ms
Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (Amb_MainMenu).
HDR Render Texture not supported, disabling HDR on reflection probe.
02/26/2021 09:41:39: Initializing world generator seed: ( 0 )   menu:True  worldgen version:1
02/26/2021 09:41:39: Using mountain distance: 1000
02/26/2021 09:41:39: Render threading mode:SingleThreaded
02/26/2021 09:41:39: Get create world [excised]
02/26/2021 09:41:39: Using environment steamid 892970
02/26/2021 09:41:39: Using steam APPID:892970
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 1 milliseconds to initialize
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
RecordSteamInterfaceCreation (PID 494): SteamGameServer013 /
RecordSteamInterfaceCreation (PID 494): SteamUtils009 /
Setting breakpad minidump AppID = 892970
RecordSteamInterfaceCreation (PID 494): SteamGameServer013 / GameServer
RecordSteamInterfaceCreation (PID 494): SteamUtils009 / Utils
RecordSteamInterfaceCreation (PID 494): SteamNetworking006 / Networking
RecordSteamInterfaceCreation (PID 494): SteamGameServerStats001 / GameServerStats
RecordSteamInterfaceCreation (PID 494): STEAMHTTP_INTERFACE_VERSION003 / HTTP
RecordSteamInterfaceCreation (PID 494): STEAMINVENTORY_INTERFACE_V003 / Inventory
RecordSteamInterfaceCreation (PID 494): STEAMUGC_INTERFACE_VERSION014 / UGC
RecordSteamInterfaceCreation (PID 494): STEAMAPPS_INTERFACE_VERSION008 / Apps
[S_API FAIL] Tried to access Steam interface SteamNetworkingUtils003 before SteamAPI_Init succeeded.
RecordSteamInterfaceCreation (PID 494): SteamNetworkingUtils003 /
RecordSteamInterfaceCreation (PID 494): SteamNetworkingSockets008 /
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
02/26/2021 09:41:39: Server ID [excised]
02/26/2021 09:41:39: Authentication:k_ESteamNetworkingAvailability_Waiting
02/26/2021 09:41:39: Steam game server initialized
02/26/2021 09:41:39: Missing audio clip in music respawn
02/26/2021 09:41:39: Builder started
02/26/2021 09:41:40: Loaded localization English
02/26/2021 09:41:40: Game server connected
Unloading 16 unused Assets to reduce memory usage. Loaded Objects now: 85969.
Total: 64.870700 ms (FindLiveObjects: 4.164900 ms CreateObjectMapping: 11.090200 ms MarkObjects: 49.317700 ms  DeleteObjects: 0.292800 ms)
Unloading 6 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 13.151600 ms
HDR Render Texture not supported, disabling HDR on reflection probe.
HDR Render Texture not supported, disabling HDR on reflection probe.
02/26/2021 09:41:41: Zonesystem Awake 299
02/26/2021 09:41:41: DungeonDB Awake 299
02/26/2021 09:41:41: Registering lobby
02/26/2021 09:41:41: Initializing world generator seed:XmPw65WVCl ( -1570306369 )   menu:False  worldgen version:1
02/26/2021 09:41:41: Using mountain distance: 1000
02/26/2021 09:41:41: Found 565 mountain points
02/26/2021 09:41:41: Remaining mountains:80
02/26/2021 09:41:41: Calc time 29.413 ms
02/26/2021 09:41:41: Found 8075 lake points
02/26/2021 09:41:43: Remaining lakes:117
02/26/2021 09:41:43: Calc time 2623.892 ms
02/26/2021 09:41:43: Rivers:152
02/26/2021 09:41:44: River buckets 14713
02/26/2021 09:41:44: River render time 353.707 ms
02/26/2021 09:41:44: River Calc time 370.493 ms
02/26/2021 09:41:45: River buckets 23797
02/26/2021 09:41:45: River render time 609.341 ms
02/26/2021 09:41:45: Placed 1919 streams
02/26/2021 09:41:45: Stream Calc time 1369.488 ms
02/26/2021 09:41:45: Load world [excised]
02/26/2021 09:41:45: Loading 81 zdos , my id 497102565 data version:26
02/26/2021 09:41:45: Loaded 0 dead zdos
02/26/2021 09:41:45: Removed 0 OLD generated ZDOS
02/26/2021 09:41:45: Loaded 7141 locations
02/26/2021 09:41:45: Audioman already exist, destroying self
Unloading 490 unused Assets to reduce memory usage. Loaded Objects now: 86302.
Total: 85.562000 ms (FindLiveObjects: 4.541000 ms CreateObjectMapping: 10.351200 ms MarkObjects: 66.980300 ms  DeleteObjects: 3.684000 ms)
02/26/2021 09:41:49: Zonesystem Start 299
02/26/2021 09:41:50: DungeonDB Start 299
trevorloflin commented 3 years ago

After more testing and thinking, I think this issue doesn't have anything to do with the docker image. It has to be some weird interaction between my OS and the Valheim server software. I'm gonna close this so it doesn't clutter your list up.