Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Why do I get "RelayServiceException: Not Found: join code not found" half of the time?

Discussion in 'Unity Transport' started by maxkcy, Sep 1, 2023.

  1. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    I am using the unity relay transport for NGO (and lobby). While trying to connect to a relay, I keep getting this error half the time, but the other half I am able to connect. Do others have this issue too?
    *XXXXXX is sub for the actual join code
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    416
    Could it be that there is a delay between the moment you create the host's allocation and the moment the host is actually started (at the NGO level)? Relay allocations will time out if they're not active for a short while. NGO will take care of keeping the allocation alive, but for that to happen you need to have started your host. So if there's a delay between when the allocation is created and the host started, and if that delay is close to the allocation timeout value, it could explain your issue.
     
  3. Richay

    Richay

    Joined:
    Aug 5, 2013
    Posts:
    109
    I was seeing this issue using Relay and DOTS Netcode, turns out it's exactly that timeout which was causing the "join code not found" error. My server created the allocation but then sometimes took longer than 10 seconds to connect the driver to Relay.
     
  4. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    Hey, sorry for not posting the solution earlier.

    I believe one of the reasons this error was occurring was due to having the same client ID (I can't remember what the technical name for this is), this did allow at least 1 client to connect, but not the rest as I was testing it out. I fixed that by setting a unique ID ( again I can't recall whether I generated the unique ID with GUID or whether there was an option to set it automatically).
     
    Richay likes this.