Search Unity

Photon 2 error on Magic Leap

Discussion in 'Scripting' started by Elisabeth123, Sep 9, 2019.

  1. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    Hi,

    I am using Photon 2 in Unity for connecting multiple players. I have the following problem: When I build the app and start in on the Magic Leap for the first time, the ML can connect to the Photon server. When I terminate the app and launch it again I cannot connect to the Photon server any more. I get the error message bellow. Does anyone has the same problem or knows what to do here? Also when I restart the glasses its the same, only a new build helps and then it is just working for the first time the app is executed. Is there a possibility to delete all settings for that app or something like this?

    Connect() to 'ns.exitgames.com' () failed: System.Net.Sockets.SocketException (0x80004005): Could not resolve host 'ns.exitgames.com'
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Net.Dns.Error_11001 (System.String hostName) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Net.Dns.hostent_to_IPHostEntry (System.String originalHostName, System.String h_name, System.String[] h_aliases, System.String[] h_addrlist) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at ExitGames.Client.Photon.IPhotonSocket.GetIpAddress (System.String address) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at ExitGames.Client.Photon.SocketUdp.DnsAndConnect () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.Networking.SyncList`1[T].SerializeItem (UnityEngine.Networking.NetworkWriter writer, T item) [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
    09-09 21:36:16.316 2778 40 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0



    BR, Elisabeth
     
  2. trigger-james

    trigger-james

    Joined:
    Aug 14, 2019
    Posts:
    8
    I am having this same issue. But for me it is on first install and every following run of the app. Any tips @tobiass ? Thanks so much!
     
    Last edited: Sep 12, 2019
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    "Could not resolve host" is a DNS error. It means whatever DNS servers which host the record for ns.exitgames.com are either responding they don't know it's IP address or the servers are inaccessible to the DNS servers on your end (or the DNS servers on your end are down). It could be a problem with their servers or internet connection, or it could be with your own internet connection, but if you are able to resolve other host names then it is probably on their end. Not really a Unity scripting issue as far as I can tell.

    You could report the problem to Exit Games if they don't resolve it quickly. When I try to ping it from here it resolves just fine though.
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    This particular problem is completely client-side. Due to the DNS issue, the client is unable to connect to the server.

    We don't know what causes this issue but this is what seems to happen: The DNS resolution of our name server address may return more than one IP for the server. In this case, not all IPs returned are reachable and when our client selects the "wrong" IP, the connection can't be established.
    This seems to be a somewhat new problem.

    The workaround should be to check each IP provided by the DNS lookup. So far, we didn't have to do this but the next updates of PUN will add this.

    I will PM you code to verify that. Would be great if you can send feedback on that later.
     
    Joe-Censored likes this.
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    I misread the initial post's error log.
    The issue "Could not resolve host 'ns.exitgames.com'" means that DNS did not work at all. This could be a misconfiguration in your network or firewalls.

    Which Unity version and builds settings do you use? IL2CPP? .Net 4.x?

    Could you try to run a script doing this:
    Dns.Resolve("ns.exitgames.com");

    What's the result?
     
  6. trigger-james

    trigger-james

    Joined:
    Aug 14, 2019
    Posts:
    8
    As for me it was a network misconfiguration. So thanks for the help with that! I'm still going to try and get you some logs for the region selection issue that we talked about when I get a free moment.

    Thanks again!
     
    tobiass likes this.