Hi! My application is using latest - Relay 1.0.5, Netcode 1.5.1 and Unity 2022.3.4f1.
If I use DTLS/useWebSockets = false, everything works great with my simple host that starts and a client that connects via Relay, and they are able to share data with no issues 100% of the time.
However, if I use wss/useWebSockets set to true, half the time I get an error on starting a host or joining via client, e.g.:
“SocketException: Could not resolve host ‘-us-east4.relay.cloud.unity3d.com’”
I can’t make any sense of this and I need to use wss as I’m trying to eventually get a webGL client with an Android host talking to each other.
Hey Travis, we are still investigating this.
We might need to have a look at the specific logs in the relay instances you are trying to reach, to locate those, if you can, we will need logs from your side with the full host name (with the unique number) and the time as well.
That is correct. Nslookup never has failed for me from this machine. Unity Relay displays this error almost all the time but not always which is the strangest part (and only when using web sockets).
OK, it confirms our other theory, that the issue was in dot net, since the webGL build code path is using the WebSocket javascript API.
We will have to contact people that are deeper within the engine to solve this one.
Thanks for your precious feedback Travis!
Gotcha, I was afraid it was be a far more complicated problem. Appreciate the effort looking into it (strange how no one else has reported it).
FWIW, right now I just have a loop of multiple attempts (delaying between each) doing the SetRelayData which triggers the error. The odd thing is sometimes it’ll set and work fine after < 10 tries, whereas other times takes almost 100 retries! (And sometimes yet it still never succeeds and I have to restart the app in editor and try again). But strangely, sometimes the SetRelayData does succeed but then the allocation will fail right after with these errors (not sure if thats helpful or not to the team ):
Received error message from Relay: allocation ID not found. 0x00007ff6d7d886da (Unity) DefaultBurstRuntimeLogCallback 0x00007ff6d745b11a (Unity) BurstCompilerService_CUSTOM_RuntimeLog 0x00007ffc69e4a321 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Networking.Transport.Logging.DebugLog.ErrorRelay (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/Library/PackageCache/com.unity.transport@2.0.2/Runtime/DebugLog.cs:171) 0x00007ffc69e545e7 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList>.ProcessReceivedMessages (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/Library/PackageCache/com.unity.transport@2.0.2/Runtime/Layers/RelayLayer.cs:303)* *0x00007ffc69e52623 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Jobs.IJobExtensions.JobStruct1<Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList>>.Execute(ref Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList> data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) → void_74ba8063da5254ef739219263a3da2e5 from UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/unknown/unknown:0) 0x00007ffc69e51f36 (eb19c3fa31f075a5294c00b580dd1dd) 8de023688c1b71ddd3534988b741c831 0x00007ff6d806c8bc (Unity) ExecuteJob 0x00007ff6d806dc7f (Unity) ForwardJobToManaged 0x00007ff6d80698dc (Unity) ujob_execute_job 0x00007ff6d8068fc4 (Unity) lane_guts 0x00007ff6d806bb24 (Unity) worker_thread_routine 0x00007ff6d82989a7 (Unity) Thread::RunThreadWrapper 0x00007ffcc82026ad (KERNEL32) BaseThreadInitThunk 0x00007ffcc8e6aa68 (ntdll) RtlUserThreadStart Relay allocation is invalid. See NetworkDriver.GetRelayConnectionStatus and RelayConnectionStatus.AllocationInvalid for details on how to handle this situation. 0x00007ff6d7d886da (Unity) DefaultBurstRuntimeLogCallback 0x00007ff6d745b11a (Unity) BurstCompilerService_CUSTOM_RuntimeLog 0x00007ffc69e4a340 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Networking.Transport.Logging.DebugLog.ErrorRelay (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/Library/PackageCache/com.unity.transport@2.0.2/Runtime/DebugLog.cs:171) 0x00007ffc69e545e7 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList>.ProcessReceivedMessages (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/Library/PackageCache/com.unity.transport@2.0.2/Runtime/Layers/RelayLayer.cs:303)* *0x00007ffc69e52623 (eb19c3fa31f075a5294c00b580dd1dd) Unity.Jobs.IJobExtensions.JobStruct1<Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList>>.Execute(ref Unity.Networking.Transport.RelayLayer.ReceiveJob1<Unity.Networking.Transport.UnderlyingConnectionList> data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) → void_74ba8063da5254ef739219263a3da2e5 from UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at C:/dev/tap-unity-simulation-webgl/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/unknown/unknown:0) 0x00007ffc69e51f36 (eb19c3fa31f075a5294c00b580dd1dd) 8de023688c1b71ddd3534988b741c831 0x00007ff6d806c8bc (Unity) ExecuteJob 0x00007ff6d806dc7f (Unity) ForwardJobToManaged 0x00007ff6d80698dc (Unity) ujob_execute_job 0x00007ff6d8068fc4 (Unity) lane_guts 0x00007ff6d806bb24 (Unity) worker_thread_routine 0x00007ff6d82989a7 (Unity) Thread::RunThreadWrapper 0x00007ffcc82026ad (KERNEL32) BaseThreadInitThunk 0x00007ffcc8e6aa68 (ntdll) RtlUserThreadStart Transport failure! Relay allocation needs to be recreated, and NetworkManager restarted. Use NetworkManager.OnTransportFailure to be notified of such events programmatically. UnityEngine.Debug:LogError (object) Unity.Netcode.Transports.UTP.UnityTransport:Update () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Transports/UTP/UnityTransport.cs:899) Shutting down due to network transport failure of UnityTransport! UnityEngine.Debug:LogError (object) Unity.Netcode.NetworkManager:HandleRawTransportPoll (Unity.Netcode.NetworkEvent,ulong,System.ArraySegment1<byte>,single) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Core/NetworkManager.cs:1748)* *Unity.Netcode.NetworkTransport:InvokeOnTransportEvent (Unity.Netcode.NetworkEvent,ulong,System.ArraySegment1,single) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Transports/NetworkTransport.cs:49) Unity.Netcode.Transports.UTP.UnityTransport:Update () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Transports/UTP/UnityTransport.cs:902)
Hi Arnaud, I was curious if there is a ticket or link we can use to track the status of this bug in case it ever gets fixed. I imagine I’m not the only who will develop web sockets and relay in the editor and run into this.