-
Notifications
You must be signed in to change notification settings - Fork 441
Realtime Database connection is flakey on desktop #106
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
Comments
Hi, I can't seem to reproduce the problem you are seeing, but one thing stands out to me in the rules you provided. If that doesn't help, if I'm reading this correctly the problem is happening in the Firebase editor, and not in a build, correct? And also, what system are you running this on (Windows/Mac/Linux)? That might help us track down what you are seeing. |
I tried changing the rules to '{ ".read": true, ".write": true }' which is what i had before but it didn't help. My operating system is Windows and I'm just testing this in the unity editor and looking in the Firebase console to see the new data, and the errors occur in the unity editor console. |
Hmm, I'll keep looking on my end to see if I can find any problems. And just to cover all cases, you are running this with an internet connection? Disabling my connection has been the only way I've been able to reproduce it yet, and a socket exception usually indicates a networking problem. |
Yes I'm connected to the internet I even tried building to android device to see if it could be a unity editor issue, but that didn't help either. |
Our best guess is that is has something to do with an internet connection problem, possibly a firewall that is blocking it? One suggestion is to turn on more log debugging, as we print out through out the connection process. To do so, you can add:
That should print out what ip address it's trying to use, the socket, etc. which might have some explanation of the problem. Another thing to try would be connecting directly with the REST api, as that will confirm that you are able to connect to your project at all. |
Never mind it just took time for my settings to start working on the router and now everything appears to be working fine. Also I believe the three settings I enabled that made Firebase connections possible again were [Multicast Enable, DNS Relay, and UPnP Enable]. Thanks a-maurice your help was much appreciated. |
I can confirm that this issue is tied into network problems related with routers.. But this is happening way too much to be ignored. Of a team of 10 devs, 5 of them have experienced this problem on public and private networks that otherwise work fine for everything else! Can we please repoen and try diagnose if there is a way to workaround this?
|
As requested I'm reopening the issue, since it seems like something that Firebase should actually resolve. |
@PathToLife is there anything you can share about your reproduction environment? Also, any chance you could try out the iOS or Android samples Since we have different network stacks between each environment it would be interesting to see whether the problem lies in there. TBH The connection to the database is simply using WebSocket, I would assume that in an environment where RT DB connections are failing you would see other connections fail. |
Hello, im having the same issue. All was working fine and suddenly this started to appear. Internet is fine. Router is like always and Rules are like always. |
1/2/0001 6:01:00 PM [Error] WebSocket: ws_17 - WebSocketException during handshake at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in :0 |
Im seeing this behaviour 2 times in same day after working a little with the Database. Same machine, same Router Config,....Log with Unreachable again...what to do? I need to put this in Production and im not sure what will happen. No idea how to manage this State either. Im trying to grab "e2.DatabaseError" with no luck too. It happens 1 time out of 100 interactions. But still is annoying because the App will crash except managing this e2.DatabaseError (if i manage to understand how). |
Same for me. Accessing realtime database is working fine in most of tested networks, including mobile hotspot, except for one private network in the office, where I constantly get the following error. It doesn't matter if I try with unity editor or from a build on iOS or Android.
Accessing Firebase realtime database via CURL and pure REST API is working fine in that network. |
I am getting the same issue with the router. Working fine with the mobile network and with a hotspot. Any suggestions? This might happen for users as well, making this an unreliable option... Unity 2017.30f3 / Firebase SDK 4.4.0 |
Having the same issue today as @EyalBira . Unity 2017.30f3 / Firebase SDK 4.4.0. Producing "WebSocketException during handshake" error. Works with my mobile Hotspot, not working through my Spectrum internet router. |
I have been encountering similar problem on multiple wi-fi networks from yesterday. Mobile hot spot works fine and I am able to connect to firebase. I get network error only for wifi connections which had been working fine till day before yesterday. |
Any updates about this issue? Temporary disabling anti-virus on my imac helped, but that is not a solution unfortunately. |
I also have same issue with Lan network but still ok with hotspot form mobilenetwork source. Anyone have solution for that, even temporary. |
In my case it was antivirus that was blocking it (Kaspersky internet security 2017) - disabling it or, disabling "Check secure connections HTTPS" in preferences temporary fixed this issue, here is response I had from firebase tech team:
|
Exact same issue.
...but if I just tether off an iPhone, works just fine. |
As it has been mentioned before this is a real issue for end users more than developers. Since developers can use a workaround to get it to work eventually, but if the end users comes across the issue they will probably not spend the time to debug it. I'd recommend that for the time being if you must use firebase with unity, it would be in your best interest to use their rest API to connect firebase database with unity, libraries like "RestSharp" or "RestClient for Unity" make this a fairly easy process. Keep in mind even if you don't come across the issue, it is possible one of your end users will come across this issue since it is due to wireless routers and their security settings. |
Well, the workaround that I just found is: |
mirzasohailbaig - would you please provide any examples how to connect to the firebase using unity and rest api ? |
Inexplicably, it works today. I changed nothing... has anybody had a similar experience? |
Sorry Mattewek, I don't use firebase anymore but the details on how to make rest requests for firebase can be found here https://firebase.google.com/docs/reference/rest/database/ . If you're using unity 2017.2 or higher I recommend using this rest client library to make it easier to write the requests. https://github.com/proyecto26/RestClient There's one problem to this though you lose the real-time aspect of firebase by doing it this way, as far as I know. |
Just change the following under Player Settings: These changes helped me overcome the issue. |
Ok, so the whole disable / enable dll instruction is a bit confusing. What I believe the op meant, and what worked for me just now (Unity 2018.3.10f21, Firebase Analytics Unity 5.6.0) was: 1: Rename the Firebase.Database.dll in /Assets/Firebase/Plugins/Mono/ to Firebase.Database.DISABLEDDLL (just to keep it around) 2: Copy Firebase.Database.dll in /Assets/Firebase/Plugins to /Assets/Firebase/Plugins/Mono/ Note: after this, Unity Complained about duplicate dlls when building to Android. To fix this:
After this, both Editor and Android (Gradle) builds work fine with the Firebase Database Important to note: You have to do all of this in the finder/explorer. The files with file ending ".dll" in the unity project explorer ARE NOT THE REAL .dll files, but have the file ending .dll.mdb if you look in finder/explorer Hope this can help anyone else stuck with this problem! |
Followed squirenetic's directions, but unfortunately it doesn't work for me. |
we cannot read/save data to firebase database in case if system time is wrong. Even if it is in seconds. So try to change system time -> choose internet time -> and select time.windows.com. |
It works for me. Thank you! |
I think the key here, is that either way this is still a work around. I think everyone here is quite anxious for an actual fix from Google that will make Firebase work (the latest firebase DLL) with Unity 2018 (and now 2019). I am also quite anxious for Firestore support. This must not be that high of a priority for Google based on how long it has taken thusfar. |
Found that the editor still has problems. For example: This problem is only in the editor. |
I tried the quickstart example again today and I'm quite disappointed to see that this hasn't been resolved. I think the honest thing to do is to clearly write in the desktop workflow page that realtime database is not supported on the desktop Unity Editor until this is resolved. I'd much rather be given an answer that clearly states, it's not a priority / it's not going to be resolved than to keep checking and getting disappointed again and again :( |
Yes it's very disappointing. Worth noting that I only get the error on my
MBP on my home wifi, tethered to 4G it's fine, and on all Windows machines
I've used it on, it works correctly. Perhaps tweaking your network config
might help in the meantime?
On Sat, 1 Jun 2019 at 12:25, Elad Lebovitch ***@***.***> wrote:
I tried the quickstart example again today and I'm quite disappointed to
see that this hasn't been resolved.
I think the honest thing to do is to *clearly write in the desktop
workflow page that realtime database is not supported on the desktop Unity
Editor until this is resolved.*
We were under the impression this was going to be resolved last year but
eventually switched to REST access to better support us during development.
I'd much rather be given an answer that clearly states, it's not a
priority / it's not going to be resolved than to keep checking and getting
disappointed again and again :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AKYSF5FQ2TOM3EZEVU5ZXGDPYJMDJA5CNFSM4DYJJB22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWW6REY#issuecomment-497936531>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKYSF5HEHJ76PVP7MB2AM5LPYJMDJANCNFSM4DYJJB2Q>
.
--
Iestyn Lloyd
CTO
Check out our VR & AR collaboration tool, VISIONxR
<http://www.futurevisual.com/visionxr>™
iestyn@futurevisual.com
www.futurevisual.com
+44 (0)7595 499100
|
@stewartmiles are there any updates on this issue? Or is it not on the roadmap anymore? |
I comfirm is a error over network... please chek your router or firewell |
@eladleb we're working on it, at the moment we think we have one more issue to solve before we can switch to the C++ implementation. |
SDK 6.2.0 release notes say moved to C++ SDK in editor, implying fixed. Such excitement. Downloading... |
With the update to the C++ implementation on the the desktop version of the SDK we expect that this should be fixed. If you still see issues please open a new bug so we can track and resolve the issue. |
Status is the same. Very sad. No way to get Firebase to function using .net 4 and Unity 2019 and macbook. Now the door is closing for using the famous .net 3.5 workaround, since 3.5 is no longer supported in Unity 2019. |
That's unfortunate to hear. What version of Unity are you still getting these problems on? Can you enable verbose logging, and provide any logs concerning this, particularly around WebSockets? To enable verbose logging, you can use:
Thanks! |
The Unity version is 2019.1.9f1,
And I havre previously used some variant of 2018, with the .net version set
to 3.5. this worked. But setting project to .net 4 gave similar websocket
error message flood like now.
That is no no longer possible. I will try to get you some logs later. The
workaround hack of disabling the editor version of dll and using the
android one works for one "run" and crashes reliably on the next one.
Needless to say this is extremely annoying, particularly considering the
maturity and general impressi on of quality of your product.
TIA
Niklas
Den tors 11 juli 2019 kl 00:18 skrev a-maurice <notifications@github.com>:
… Hi @fingerfunkerNick <https://github.com/fingerfunkerNick>
That's unfortunate to hear. What version of Unity are you still getting
these problems on?
Can you enable verbose logging, and provide any logs concerning this,
particularly around WebSockets? To enable verbose logging, you can use:
Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Verbose;
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AAD2OENBIOEA22XKJ4MLO5TP6ZN4PA5CNFSM4DYJJB22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZU5I7A#issuecomment-510252156>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD2OELOP4VHNRPBSHX2V4TP6ZN4PANCNFSM4DYJJB2Q>
.
--
niklas wörmann
fingerfunk ab
valborgsmässovägen 11
126 37 Hägersten Sweden
+46 70 0720292
<http://www.fingerfunk.se/>
|
For the record, the C++ implementation has been working great for me. Unity 2018.3.f1 |
Well, I have tried connecting thru my Office Wifi, and now on my tethered
Android phone, same thing.
the logs are basically:
7/16/2019 1:08:30 PM [Error] WebSocket: ws_19 - WebSocketException during
handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host:
bisevogamificationbeta.firebaseio.com --->
System.Net.Sockets.SocketException: No route to host
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP)
[0x000b6] in <0079a30f96a047348857e1cecc6c638a>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remoteEP)
[0x00033] in <0079a30f96a047348857e1cecc6c638a>:0
at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket ()
[0x000ea] in
Z:\tmp\tmp.CfMemjIYQK\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.CfMemjIYQK\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:327
at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x0001b]
in
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:386
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at
Z:\tmp\tmp.4oHf4jn9P6\firebase\app\client\unity\src\Unity\FirebaseLogger.cs:19)
Firebase.Unity.UnityLoggingService:LogMessage(PlatformLogLevel, String) (at
Z:\tmp\tmp.4oHf4jn9P6\firebase\app\client\unity\src\Unity\UnityLoggingService.cs:13)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String) (at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\Logging\DefaultLogger.cs:68)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level,
String, String, Int64) (at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\Logging\DefaultLogger.cs:32)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception) (at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\Logging\LogWrapper.cs:36)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
(at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:143)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader() (at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:468)
Firebase.Database.Internal.TubeSock.Runnable101:Run() (at
Z:\tmp\tmp.CfMemjIYQK\firebase\database\client\mono\Database\Internal\TubeSock\WebSocket.cs:516)
Google.Sharpen.Thread:InternalRun() (at
Z:\tmp\tmp.E3dmJ1Obf7\third_party\dotnet_src\sharpen\Sharpen\Thread.cs:80)
System.Threading.ThreadHelper:ThreadStart_Context(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext,
ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback,
Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback,
Object)
System.Threading.ThreadHelper:ThreadStart()
repeat ad nauseam ;(
Sorry about the very unspecific bug report
Dont really know what else to do here. The project is huge, and I honestly
dont have time to create a barebones testing project. Maybe in a couple of
weeks....
Thanks anyway
//niklas
Den tors 11 juli 2019 kl 21:12 skrev greglieb <notifications@github.com>:
… For the record, the C++ implementation has been working great for me.
Unity 2018.3.f1
Mac OS High Sierra
.Net 4 SDK
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AAD2OEPJX47QFZBGD3LYT2DP66A2RA5CNFSM4DYJJB22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXWJNY#issuecomment-510616759>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD2OEMY5BWOT5MEMDRG5BTP66A2RANCNFSM4DYJJB2Q>
.
--
niklas wörmann
fingerfunk ab
valborgsmässovägen 11
126 37 Hägersten Sweden
+46 70 0720292
<http://www.fingerfunk.se/>
|
This work on Unity Editor and Android device well |
Appears to be working for me as well! Removed the previous REST code At last! |
I'm using unity 5.5.0f3 with Firebase version 4.1.0 and whenever I try to run the Main scene for realtime database using my URL in the
app.SetEditorDatabaseUrl("XXX");
it fails I made sure to set these rules{ "rules": { ".read": "auth == null", ".write": "auth == null" } }
Another note is this use to work fine before with an older version of the Firebase SDK but now both the new Firebase SDK and the old Firebase SDK version now give me this error when running in editor. I have a feeling there is something blocking it from connecting to my Firebase but i'm not sure what it is.
The text was updated successfully, but these errors were encountered: