[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketException during handshake on 2019.1 #386

Closed
michelleran opened this issue Jun 15, 2019 · 6 comments
Closed

WebSocketException during handshake on 2019.1 #386

michelleran opened this issue Jun 15, 2019 · 6 comments

Comments

@michelleran
Copy link
michelleran commented Jun 15, 2019

Please fill in the following fields:

Unity editor version: 2019.1.3f1
Firebase Unity SDK version: 6.1.1
Firebase plugins in use (Auth, Database, etc.): Analytics, Database
Additional SDKs you are using (Facebook, AdMob, etc.): none
Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): editor, iOS, Android

Please describe the issue here:

Unity project using Firebase SDKs (.NET 4.x) crashes when trying to run in the editor with the following error:

6/15/2019 3:06:08 PM [Error] WebSocket: ws_0 - could not connect
System.Net.Sockets.SocketException (0x80004005): No route to host
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b6] in <c9226b2f33b7421e85bb391f94075e49>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remoteEP) [0x00033] in <c9226b2f33b7421e85bb391f94075e49>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x000ea] in Z:\tmp\tmp.8Sor2bVQK4\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:323 
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.o008zdRzg2/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:19)
Firebase.Unity.UnityLoggingService:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.o008zdRzg2/firebase/app/client/unity/src/Unity/UnityLoggingService.cs:13)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/DefaultLogger.cs:68)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/DefaultLogger.cs:32)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/LogWrapper.cs:36)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:143)
Firebase.Database.Internal.TubeSock.WebSocket:CreateSocket() (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:325)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader() (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:386)
Firebase.Database.Internal.TubeSock.Runnable101:Run() (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:516)
Google.Sharpen.Thread:InternalRun() (at Z:/tmp/tmp.gUud70lzn5/third_party/dotnet_src/sharpen/Sharpen/Thread.cs:80)
System.Threading.ThreadHelper:ThreadStart()

6/15/2019 3:06:08 PM [Error] WebSocket: ws_0 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: megasim-9bbf2.firebaseio.com ---> System.Net.Sockets.SocketException: No route to host
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b6] in <c9226b2f33b7421e85bb391f94075e49>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remoteEP) [0x00033] in <c9226b2f33b7421e85bb391f94075e49>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x000ea] in Z:\tmp\tmp.8Sor2bVQK4\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:323 
   --- End of inner exception stack trace ---
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x0010c] in Z:\tmp\tmp.8Sor2bVQK4\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:327 
  at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x0001b] in Z:\tmp\tmp.8Sor2bVQK4\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:386 
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.o008zdRzg2/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:19)
Firebase.Unity.UnityLoggingService:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.o008zdRzg2/firebase/app/client/unity/src/Unity/UnityLoggingService.cs:13)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/DefaultLogger.cs:68)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/DefaultLogger.cs:32)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/Logging/LogWrapper.cs:36)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception) (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:143)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader() (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:468)
Firebase.Database.Internal.TubeSock.Runnable101:Run() (at Z:/tmp/tmp.8Sor2bVQK4/firebase/database/client/mono/Database/Internal/TubeSock/WebSocket.cs:516)
Google.Sharpen.Thread:InternalRun() (at Z:/tmp/tmp.gUud70lzn5/third_party/dotnet_src/sharpen/Sharpen/Thread.cs:80)
System.Threading.ThreadHelper:ThreadStart()

Steps to reproduce:

  1. Create new Unity project
  2. Add iOS and Android config files
  3. Update package names accordingly
  4. Import Firebase Analytics and Database
  5. Create script initializing Firebase app and database and attach to camera
  6. Run game in editor

How do I fix this?

@michelleran michelleran added the new New issue. label Jun 15, 2019
@patm1987
Copy link

Hi @michelleran, thanks for reporting this issue!

Can you answer a few more questions for me?

  1. does it work on your Android device or is it just broken in the editor
  2. if it does only break in the editor, does it break under all network conditions? Desktop support for Realtime Database is beta, and there are some corner cases not handled that usually result from corner cases around corporate firewalls.
  3. Try disabling the dll at "Firebase/Plugins/Mono/Firebase.Database.dll" and enabling the one at "Firebase/Plugins/Firebase.Database.dll". If this is successful, make sure that this hack doesn't live into your device builds, as this one will lend to a generally worse (slower) experience on devices.

For more information on what I suspect this is see bug #106 . Let me know if that helps (so I can mark this as a duplicate or see if it needs further investigation).

@patm1987 patm1987 added type: question and removed new New issue. labels Jun 19, 2019
@alexames
Copy link

Hi @michelleran,

Have you tried running the unity database testapp in this repository? If not, try running it and seeing if you get the same error.

@michelleran
Copy link
Author

@alexames yep, same error (using .NET 4.x SDKs and Unity 2019.1.6f1).

@patm1987 it works on Android, as well as with Mono/Firebase.Database.dll disabled. I don't think it breaking in the editor is because of network conditions since I'm connected to a home network, which, as far as I'm aware, doesn't have any unusual configurations.

@patm1987
Copy link

Duplicate of #106

@patm1987 patm1987 marked this as a duplicate of #106 Jun 20, 2019
@patm1987
Copy link

I do think that this is likely a duplicate of bug #106. The callstacks look the same and the same workaround seems to work for you. If you disagree, let me know!

@stewartmiles
Copy link
Contributor

Closing as a dupe of #106

@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants