Valheim

Valheim

boschinator Feb 18, 2021 @ 8:33am
dedicated server: Got connection failed callback
So, I am trying to get my dedicated server running for a few days now. It is a dedicated server running Debian 10.8 hosted by Hetzner which also runs other services for me. And yes, I checked that the selected ports are not used by other services.
In theory, everything looks good: process is starting, wold is being created, nothing special to notice.
The server does not show up in the gameserver list, but we all now that is happening for a lot of people.
So I add the server via "Steam -> View -> Servers -> Favorites" on port 2457 and it pops up and shows online. So far, so good.
If I then try to connect (using the steam server view), I can enter the password and my valheim game is starting. I get right into the character selection screen and press "start".
I then get the "loading ...." indicator at the bottom right and after a few seconds I get back into the starting screen of the game with a "Disconnected" Message.

On server side I see the following output:

Feb 18 16:58:31 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:31: Got session request from [USERSTEAMID] Feb 18 16:58:31 servername start_valheimserver.sh[10210]: Feb 18 16:58:31 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: STEAMPS3 - AsyncTCPSocket created Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Got connection failed callback: [USERSTEAMID] Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket [USERSTEAMID] Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: send queue size:0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: P2P state, bytes in send queue:0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: STEAMPS3 - AsncTCPSocket destroyed Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Disposing socket Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket 0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Disposing socket Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket 0

This is reproducable every time. Stuff I tried (without success):

  • rename worlds (so creating new ones from scratch)
  • rename server
  • rename password
  • try completely different port range (23456 f.e.)
  • play around with all the server parameters I could find (batchmode / nographics / public)
  • disabled openvpn service on server to not have any other network interface available (yes the server is running other services)
  • rebooted server
  • even tried starting script as root once

I game itself runs on my client without any noticeable problems (until now). I ran a local world and was even possible to connect to other servers successfully.
So this really seems to be something messy with the server / special requirements.
I have stumbled on an entry on reddit which has the same problem it seems:
https://www.reddit.com/r/valheim/comments/ll927v/valheim_dedicated_liknux_server_disconnect_when/

Anybody has some ideas? I am running out of stuff to test to get this running :\
< >
Showing 1-15 of 19 comments
boschinator Feb 18, 2021 @ 8:42am 
Forgot some things in the list:


And some more insights:
The public IP of the server is directly mapped to the nic.
IPv6 IS enabled.
My client is also running linux. There is no "third party software" installed which "optimizes" my network connection - and as stated: connecting to other servers is working.
Last edited by boschinator; Feb 18, 2021 @ 8:44am
TTR Feb 18, 2021 @ 8:50am 
Try adding your server:2456 to steam server view.
Hit refresh and wait for it to show up with the right name and etc. As soon as it shows up try hitting stop refresh. Now try to connect.
Idk if it's the steam servers view having issues or the actual server having issues but that's the only way I could get my friends to connect to my server. Only way I can do it from outside my LAN too.
boschinator Feb 18, 2021 @ 10:15am 
Originally posted by TTR:
Try adding your server:2456 to steam server view.
Hit refresh and wait for it to show up with the right name and etc. As soon as it shows up try hitting stop refresh. Now try to connect.
Idk if it's the steam servers view having issues or the actual server having issues but that's the only way I could get my friends to connect to my server. Only way I can do it from outside my LAN too.


Thank you for taking the time to reply and try to help.
But it seems you haven't fully read my problem / initial post. I have the server listed in the "steam server view" and it is showing as online. I can click connect and it reaches the server (as seen in the log file pasted above). I just then get disconnected by the server and are unable to finish the connect.
Just as an addition: I need to put port 2457 in the "steam server view" as also mentioned in other troubleshooting posts.
TTR Feb 18, 2021 @ 11:16am 
Ok no worries. My issue was that the server was showing as non-responding. Sounds like you have a different issue. I don't know what the dependencies are on Linux but since it runs on Unity I would assume you at least need to have Mono Runtime installed and updated. Maybe see if you can update mono?
Shroom Feb 18, 2021 @ 12:37pm 
I am having the same problem, but running on windows. I have tried much the same as the op and also gone as far as totally disabling firewall and passing through all ports, with the same results as above.

On the client, the screen goes black, I hear waves sound, then after a short period the cursor icon shows and I am back to the selection screen with a disconnected notice. This is the same, using favourite servers to connect from steam, or in game with the join IP.

Sorry I can't offer any help OP, but thought at least me putting this may highlight a non-OS constrained view on things.
boschinator Feb 18, 2021 @ 12:51pm 
Thanks for sharing @Shroom. Yes, that does sound as exactly the same behavior.

In the mean time I've tried to debug with unity parameters: setting "-logFile" and even "-stackTraceLogType" on command line. But that gives (at least me), not more insights. Googling for "Steamworks.P2PSessionConnectFail_t" did not really bring something up.

I also validated ulimit settings for the process (linux specific) - all looks good.

Just for completion, the log file running with "stackTraceLogType Full":

02/18/2021 21:20:41: Got session request from [USERSTEAMID] #0 GetStacktrace(int) #1 DebugStringToFile(DebugStringToFileData const&) #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) 02/18/2021 21:20:56: Got connection failed callback: [USERSTEAMID] #0 GetStacktrace(int) #1 DebugStringToFile(DebugStringToFileData const&) #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) #4 (Mono JIT Code) (wrapper delegate-invoke) Steamworks.Callback`1/DispatchDelegate<Steamworks.P2PSessionConnectFail_t>:invoke_void_T (Steamworks.P2PSessionConnectFail_t) (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) 02/18/2021 21:20:56: Closing socket [USERSTEAMID] #0 GetStacktrace(int) #1 DebugStringToFile(DebugStringToFileData const&) #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) #4 (Mono JIT Code) (wrapper delegate-invoke) Steamworks.Callback`1/DispatchDelegate<Steamworks.P2PSessionConnectFail_t>:invoke_void_T (Steamworks.P2PSessionConnectFail_t) (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) 02/18/2021 21:20:56: send queue size:0 #0 GetStacktrace(int) #1 DebugStringToFile(DebugStringToFileData const&) #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) #4 (Mono JIT Code) (wrapper delegate-invoke) Steamworks.Callback`1/DispatchDelegate<Steamworks.P2PSessionConnectFail_t>:invoke_void_T (Steamworks.P2PSessionConnectFail_t) (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) 02/18/2021 21:20:56: P2P state, bytes in send queue:0 #0 GetStacktrace(int) #1 DebugStringToFile(DebugStringToFileData const&) #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) #4 (Mono JIT Code) (wrapper delegate-invoke) Steamworks.Callback`1/DispatchDelegate<Steamworks.P2PSessionConnectFail_t>:invoke_void_T (Steamworks.P2PSessionConnectFail_t) (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) 02/18/2021 21:20:56: Disposing socket
Last edited by boschinator; Feb 18, 2021 @ 12:52pm
boschinator Feb 18, 2021 @ 1:03pm 
So just going for "Steamworks p2p" brings me right back to the URL I already posted with the related steam p2p ports:

Steamworks P2P Networking and Steam Voice Chat UDP remote port 3478 UDP remote port 4379 UDP remote port 4380

And again, opening these ports doesn't do anything
boschinator Feb 18, 2021 @ 1:08pm 
Originally posted by Shroom:
I am having the same problem, but running on windows. I have tried much the same as the op and also gone as far as totally disabling firewall and passing through all ports, with the same results as above.

One question @Shroom: do you have IPv6 enabled on the windows machines primary network interface running the server? Kind of the only guess I currently have about this behaviour.


Disabling IPv6 and testing this is a bit hard for me.. as I said there are other services running on the server and I am actually using IPv6 for them.
boschinator Feb 18, 2021 @ 1:30pm 
Making progress! It seems to be working now.

My server provider (Hetzner) has a "stateless / static firewall" feature. This, however, does not allow communication flow. So it seems to cut off communication for that Steamworks p2p communication.
They describe it like this:

A static firewall only makes decisions about packets by inspecting individual packets. Therefore, the firewall doesn't "keep track of" whether or not an incoming packet belongs to an out-going connection from the server. For this reason, unless you enter an additional rule, all out-going connections from the server will not work.

So I added / allowed outgoing UDP packages in the ephemeral port range ("32768-65535") for that feature. Maybe this helps anybody in the future.
TTR Feb 18, 2021 @ 3:29pm 
Originally posted by boschinator:
Making progress! It seems to be working now.

My server provider (Hetzner) has a "stateless / static firewall" feature. This, however, does not allow communication flow. So it seems to cut off communication for that Steamworks p2p communication.
They describe it like this:

A static firewall only makes decisions about packets by inspecting individual packets. Therefore, the firewall doesn't "keep track of" whether or not an incoming packet belongs to an out-going connection from the server. For this reason, unless you enter an additional rule, all out-going connections from the server will not work.

So I added / allowed outgoing UDP packages in the ephemeral port range ("32768-65535") for that feature. Maybe this helps anybody in the future.

Man you basically opened 50% of your UDP ports. I wouldn't recommend doing that.
You should only need to open 2456-2458 TCP&UDP.
Matixto Feb 18, 2021 @ 3:46pm 
Originally posted by boschinator:
So, I am trying to get my dedicated server running for a few days now. It is a dedicated server running Debian 10.8 hosted by Hetzner which also runs other services for me. And yes, I checked that the selected ports are not used by other services.
In theory, everything looks good: process is starting, wold is being created, nothing special to notice.
The server does not show up in the gameserver list, but we all now that is happening for a lot of people.
So I add the server via "Steam -> View -> Servers -> Favorites" on port 2457 and it pops up and shows online. So far, so good.
If I then try to connect (using the steam server view), I can enter the password and my valheim game is starting. I get right into the character selection screen and press "start".
I then get the "loading ...." indicator at the bottom right and after a few seconds I get back into the starting screen of the game with a "Disconnected" Message.

On server side I see the following output:

Feb 18 16:58:31 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:31: Got session request from [USERSTEAMID] Feb 18 16:58:31 servername start_valheimserver.sh[10210]: Feb 18 16:58:31 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: STEAMPS3 - AsyncTCPSocket created Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Got connection failed callback: [USERSTEAMID] Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket [USERSTEAMID] Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: send queue size:0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: P2P state, bytes in send queue:0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: STEAMPS3 - AsncTCPSocket destroyed Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Disposing socket Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket 0 Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Disposing socket Feb 18 16:58:46 servername start_valheimserver.sh[10210]: Feb 18 16:58:46 servername start_valheimserver.sh[10210]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Feb 18 16:58:46 servername start_valheimserver.sh[10210]: 02/18/2021 16:58:46: Closing socket 0

This is reproducable every time. Stuff I tried (without success):

  • rename worlds (so creating new ones from scratch)
  • rename server
  • rename password
  • try completely different port range (23456 f.e.)
  • play around with all the server parameters I could find (batchmode / nographics / public)
  • disabled openvpn service on server to not have any other network interface available (yes the server is running other services)
  • rebooted server
  • even tried starting script as root once

I game itself runs on my client without any noticeable problems (until now). I ran a local world and was even possible to connect to other servers successfully.
So this really seems to be something messy with the server / special requirements.
I have stumbled on an entry on reddit which has the same problem it seems:
https://www.reddit.com/r/valheim/comments/ll927v/valheim_dedicated_liknux_server_disconnect_when/

Anybody has some ideas? I am running out of stuff to test to get this running :\

Happening to me too, OVH Windows Server + ports 2456-2458 opened TCP/UDP
In my office I can connect to the server, but no one can from home, rare as ♥♥♥♥. Any clue?
TTR Feb 18, 2021 @ 4:38pm 
Opening the ports on your router might not be enough.
Try creating firewall rules for the ports on the Windows Server.
Matixto Feb 18, 2021 @ 5:15pm 
Originally posted by TTR:
Opening the ports on your router might not be enough.
Try creating firewall rules for the ports on the Windows Server.
Yeah, I did it too. Both in the regular IP firewall, Windows firewall and GAME antiddos firewall
TTR Feb 18, 2021 @ 10:57pm 
Damn then I don't know :/
Matixto Feb 19, 2021 @ 3:36am 
Its very rare, I can connect from my office's PC but not from my home's PC
< >
Showing 1-15 of 19 comments
Per page: 1530 50

Date Posted: Feb 18, 2021 @ 8:33am
Posts: 19