Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Error] WebSocket: ws_0 -Could not connect

Discussion in 'Linux' started by Nomadjackalope, Jan 24, 2018.

  1. Nomadjackalope

    Nomadjackalope

    Joined:
    Jul 12, 2016
    Posts:
    16
    System.Net.Sockets.SocketsException: Network is unreachable

    I must have broken something. I haven't done much with this project in a while (adding a scrollview to a scene) and tried running it in the editor today but this error occurred. It's using the Firebase plugin.

    Current setup:
    Elementary OS 0.4.1 Loki - Built on "Ubuntu 16.04.3 LTS"
    Linux 4.4.0-109-generic
    Unity 2017.2.0b2

    Things I tried to fix it:
    Try on a different version of Unity 2017.3.0b1 by setting up a brand new project, importing Firebase Analytics, Database, Messaging, and Auth.
    Typed "System.Net.Sockets.Socket" which all autocompleted well but ".Connect" didn't show.

    EDIT: Tried on a different computer using the same OS and Unity and the same thing happened.



    1/24/2018 9:27:07 PM [Error] WebSocket: ws_0 - could not connect
    System.Net.Sockets.SocketException: Network is unreachable
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
    at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
    at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0
    UnityEngine.Debug:LogError(Object)
    Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String)
    Firebase.Unity.UnityLoggingService:LogMessage(PlatformLogLevel, String)
    Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
    Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
    Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
    Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
    Firebase.Database.Internal.TubeSock.WebSocket:CreateSocket()
    Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
    Firebase.Database.Internal.TubeSock.Runnable101:Run()
    Google.Sharpen.Thread:InternalRun()
     
    Last edited: Jan 25, 2018
  2. Nomadjackalope

    Nomadjackalope

    Joined:
    Jul 12, 2016
    Posts:
    16
    I found the following in Editor.Log occurring just before the socket exception.


    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.so
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/.//System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/./lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.so
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.so
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/./lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/./lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.so
    Fallback handler could not load library /home/benjamin/Unity-2017.3.0p2/Editor/Data/Mono/lib/lib/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
     
  3. LvM2D

    LvM2D

    Joined:
    Aug 23, 2015
    Posts:
    5
    @Nomadjackalope Have you resolved this bug yet? If it done, let me know solution, thanks.
     
  4. Nomadjackalope

    Nomadjackalope

    Joined:
    Jul 12, 2016
    Posts:
    16
    Unfortunately I have not. I stopped working on the project for a couple weeks, then opened it up and it worked again.

    I wish I knew all the things I tried but I did spend two weeks prior to stopping work on it trying to fix it. I do think I got it working on my mac by updating to the latest Unity and updating Firebase.

    According to my stackoverflow post I got it working by changing the .Net version in project settings "...switching to 4.6 in my 2017.2.0b2 project made it not open but switching to 4.6 in 2017.3.0b1 worked." Though, this might have caused other errors.
     
  5. Deedu_4u

    Deedu_4u

    Joined:
    May 20, 2018
    Posts:
    1
    I ran into the same issue trying to run on iOS and spent two days trying to find the issue. Following the unity/firebase docs word for word I kept running into this. What finally worked for me was changing my .NET version from 3.5 to 4.x under Player Settings -> Scripting Runtime Version.

    Hope this helps!
     
    knobby67 likes this.
  6. KlawitterGroupLLC

    KlawitterGroupLLC

    Joined:
    Dec 11, 2016
    Posts:
    1
    The solution to this is to go into the Firebase folder then plugins and finally mono. Then click on the Firebase.Database file, on the import settings make sure it doesn't include any platforms and click apply. Then go back out of the mono folder and in the plugins folder you should currently be in , click on the Firebase.Database file and on the import settings make sure it includes all platforms and click apply. This is not my fix I would cite if I remembered who found it.
     
  7. anjuman

    anjuman

    Joined:
    Dec 8, 2014
    Posts:
    3
    It is fixed in new firebase_sdk_v6.2.1 July release