com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
A ConnectionRequestMessage was received from a client when the connection has already been established
We got this error after upgrading our project from Netcode version 1.2.0
to 1.5.2
, which prevents us going forth with the upgrade for now. I've redacted the "message content" in the error message in case it contains Steam IDs or other private info. Let me know if it would be useful to have.
Posted originally as a reply to another issue: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2601
Description
When a client attempts to connect to a hosted server (using Steam Networking Transport), the host sometimes gets the following error, and the client is unable to connect.
[Netcode] A ConnectionRequestMessage was received from a client when the connection has already been established. This should not happen. Please report this to the Netcode for GameObjects team at https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues and include the following data: Message Size: 90. Message Content: <redacted>
UnityEngine.Debug:LogError (object)
Unity.Netcode.NetworkLog:LogError (string) (at ./Library/PackageCache/[email protected]/Runtime/Logging/NetworkLog.cs:34)
Unity.Netcode.NetworkManagerHooks:OnVerifyCanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/[email protected]/Runtime/Messaging/NetworkManagerHooks.cs:79)
Unity.Netcode.NetworkMessageManager:CanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/[email protected]/Runtime/Messaging/NetworkMessageManager.cs:325)
Unity.Netcode.NetworkMessageManager:HandleMessage (Unity.Netcode.NetworkMessageHeader&,Unity.Netcode.FastBufferReader,ulong,single,int) (at ./Library/PackageCache/[email protected]/Runtime/Messaging/NetworkMessageManager.cs:407)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue () (at ./Library/PackageCache/[email protected]/Runtime/Messaging/NetworkMessageManager.cs:458)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:42)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/[email protected]/Runtime/Core/NetworkUpdateLoop.cs:185)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/[email protected]/Runtime/Core/NetworkUpdateLoop.cs:208)
Reproduce Steps
- Host a server with Steam Networking Transport.
- Connect to the hosted server as client. Latency might be a factor (this occurred to us when connecting between Europe and North America).
- Repeat the steps multiple times.
- Notice that the client is unable to connect and the host gets an error.
Unfortunately, we don't have a small test project to share.
Actual Outcome
Hosted server gets an error and prevents a client from connecting.
Expected Outcome
Hosted server gets no error and client is able to connect.
Environment
- OS: Windows 10
- Unity Version: 2022.3.7f1
- Netcode Version: 1.5.2
- Netcode Commit: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/36368846c5bfe6cfb93adc36282507614955955c
@A1win If this exclusively happens with the steam networking transport, it is likely to be an issue with the transport (i.e., it is delivering us duplicate messages). I suggest trying your project using Unity Transport. If the issue doesn't happen with Unity Transport, please file this issue with the steam networking transport developers.