Hello,
We have some timeout happening kinda randomly while playing 1v1.
We are using Unity2020.2.2f1 and the Master Server Kit package (Master Server Kit | Network | Unity Asset Store), which uses Unity Multiplayer HLAPI 1.0.8, along with Kubernetes/Agones to spawn game servers in the cloud.
The logs (a bit obfuscated to remove our IPs) are as follow :
Log Game Server:
INFO,[05/17/2022 09:46:35][INFO] OnGameServerRegistrationRequested Userid : 2
INFO,"[05/17/2022 09:46:36][INFO] [MSK.BaseServer.OnPlayerInfoReceived] Player not found, creating"
INFO,[05/17/2022 09:46:36][INFO] AddPlayer 2 - username: Client1
INFO,[05/17/2022 09:46:36][INFO] [MSK.BaseServer.AddPlayer] adding player: Client1
INFO,"Log: connection {1} has been disconnected by timeout; address {::ffff:ZoneServerAddress:58802} time {266004}, last rec time {259969} rtt {55} timeout {6000}"
INFO,[05/17/2022 09:46:41][WARN] OnServerDisconnect initiated by . Last error : Timeout.
INFO,"Empty player list given to NetworkServer.Destroy(), nothing to do."
INFO,ServerDisconnected due to error: Timeout
INFO,[05/17/2022 09:46:41][INFO] RemovePlayer by conn id: 1
INFO,[05/17/2022 09:46:41][WARN] [MSK.BaseServer.RemovePlayer] player not found in list for id: 1
INFO,[05/17/2022 09:46:51][INFO] Received AwaitingPlayerJoin msg - connectionId 6
INFO,"[05/17/2022 09:46:51][INFO] [MSK.BaseServer.OnPlayerInfoReceived] Player not found, creating"
INFO,[05/17/2022 09:46:51][INFO] AddPlayer 1 - username: Client2
INFO,[05/17/2022 09:46:51][INFO] [MSK.BaseServer.AddPlayer] adding player: Client2
INFO,[05/17/2022 09:46:52][INFO] Game started ! (from CheckForGameStarted coroutine)
INFO,[ServerSide - OnChosenManaPool] Msg sent from player NetworkInstanceId 3
INFO,"[ClearManaPool] User chose:0 - ManaPool 0: 0, 0, 2, 0, 0, 0 / ManaPool 1: 0, 0, 1, 0, 0, 0"
INFO,"Log: connection {1} has been disconnected by timeout; address {::ffff:Client1Address:59289} time {298680}, last rec time {292659} rtt {53} timeout {6000}"
INFO,Warning OnServerDisconnect initiated by . Last error : Timeout.
INFO,[05/17/2022 09:47:14][WARN] OnServerDisconnect initiated by . Last error : Timeout.
INFO,ServerDisconnected due to error: Timeout
INFO,[05/17/2022 09:47:14][INFO] RemovePlayer by conn id: 1
INFO,[05/17/2022 09:47:14][INFO] [MSK.BaseServer.RemovePlayer] player remove: Client1
INFO,[05/17/2022 09:47:14][INFO] Opponent disconnected.
INFO,"Log: connection {2} has been disconnected by timeout; address {::ffff:Client2Address:52099} time {298860}, last rec time {292794} rtt {31} timeout {6000}"
INFO,Warning OnServerDisconnect initiated by . Last error : Timeout.
INFO,[05/17/2022 09:47:14][WARN] OnServerDisconnect initiated by . Last error : Timeout.
INFO,ServerDisconnected due to error: Timeout
INFO,[05/17/2022 09:47:14][INFO] RemovePlayer by conn id: 2
INFO,[05/17/2022 09:47:14][INFO] [MSK.BaseServer.RemovePlayer] player remove: Client2
INFO,Verbose Closing empty game server
INFO,[05/17/2022 09:47:14][INFO] Closing empty game server
Log Client1:
Warning: Attempt to send to not connected connection {1}
Error: Failed to send internal buffer channel:0 bytesToSend:4
Error: Send Error: WrongConnection channel:0 bytesToSend:4
Error: ClientDisconnected due to error: Timeout
Log Client2:
Error: ClientDisconnected due to error: Timeout
From what I’ve gathered, the ZoneServer first spawns the GameServer, then gets disconnected because it has nothing left to do with it once it is launched as a standalone.
Then, the player who requested the GameServer gets connected (Client1).
Then the other player joins the GameServer (Client2).
Then, the game is started.
Then, Client1 does an action which sends a message to the GameServer and at that point, the timeout happens which triggers a serie of timeout on both clients and server side, which crashes the entire game.
We are kinda clueless as to where we could dig to get more info / how we could fix this, but if you have any idea, feel free to share.
Thanks.