Unity-Technologies / Unity-Technologies/multiplayer-community-contributions

[SteamNetworkingSockets] A ConnectionRequestMessage was received from a client when the connection has already been established (Netcode 1.5.2)

Open
#239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
555
Forks
197
Avg merge
4d 12h
Merged PRs (30d)
1

Description

We started to get this error after upgrading our project from Netcode version 1.2.0 to 1.5.2.

This doesn't occur with Unity Transport when running two instances of the project on the same machine. I don't have an easy way to test this over the Internet using other transports.

Also reported on Netcode issue tracker: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2704

Description

When a client attempts to connect to a hosted server (using SteamNetworkingSockets Transport), the host sometimes gets the following error, and the client is unable to connect.

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.

[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/com.unity.netcode.gameobjects@1.5.2/Runtime/Logging/NetworkLog.cs:34)
Unity.Netcode.NetworkManagerHooks:OnVerifyCanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Messaging/NetworkManagerHooks.cs:79)
Unity.Netcode.NetworkMessageManager:CanReceive (ulong,System.Type,Unity.Netcode.FastBufferReader,Unity.Netcode.NetworkContext&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Messaging/NetworkMessageManager.cs:325)
Unity.Netcode.NetworkMessageManager:HandleMessage (Unity.Netcode.NetworkMessageHeader&,Unity.Netcode.FastBufferReader,ulong,single,int) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Messaging/NetworkMessageManager.cs:407)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Messaging/NetworkMessageManager.cs:458)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Core/NetworkManager.cs:42)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Core/NetworkUpdateLoop.cs:185)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.5.2/Runtime/Core/NetworkUpdateLoop.cs:208)
Reproduce Steps
  1. Host a server with Steam Networking Transport.
  2. Connect to the hosted server as client. Latency might be a factor (this occurred to us when connecting between Europe and North America).
  3. Repeat the steps multiple times.
  4. Notice that the client is sometimes 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the connection sequence with Steam Networking Transport using the listed Unity and Netcode versions, then inspect NetworkManagerHooks.cs and NetworkMessageManager.cs at the stack-trace locations. Compare repeated hosted-server connections under latency; done means the client connects successfully without the duplicate ConnectionRequestMessage error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.