Required SETTINGS preface not received
SergeyTrukhachev opened this issue · 5 comments
How frequently does the bug occur?
Sometimes
Description
I observe this type of issue for ~1% of my users. I cannot reproduce it, but I see this crash in Firebase Crashlytics, and users report that they cannot get into the app. For some users, VPN helps; for others, it doesn't. Please advise how to fix this. I don't see any stack trace that leads to my code, so I have no idea where to start.
Stacktrace & log output
Fatal Exception: io.realm.mongodb.AppException: java.io.IOException: Required SETTINGS preface not received
at io.realm.internal.network.NetworkRequest.onError(NetworkRequest.java:69)
at io.realm.internal.objectstore.OsJavaNetworkTransport.nativeHandleResponse(OsJavaNetworkTransport.java)
at io.realm.internal.objectstore.OsJavaNetworkTransport.handleResponse(OsJavaNetworkTransport.java)
at io.realm.internal.network.OkHttpNetworkTransport$1.run(OkHttpNetworkTransport.java:102)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Can you reproduce the bug?
No
Reproduction Steps
No response
Version
io.realm:realm-gradle-plugin:10.16.1
What Atlas App Services are you using?
Both Atlas Device Sync and Atlas App Services
Are you using encryption?
Yes
Platform OS and version(s)
Android, different versions
Build environment
Android Studio version: ...
Android Build Tools version: ...
Gradle version: ...
This exception comes from OkHttp and indicates that the network connection was somehow not correct:
It complains about this in the HTTP2 protocol: https://httpwg.org/specs/rfc7540.html#SETTINGS
This is unfortunately out of our control and is probably a consequence of people being on a particular network, perhaps behind a firewall or proxy. The best you can do is retry the operation and if it keeps failing, report it to the user or do some other fallback.
@cmelchior thank you for you input.
Btw, I found something that might be helpful.
This issue started to happen when I updated realm plugin from 10.11.1 to 10.16.1 together with gradle from 7.4.2 to 8.1.2.
Before that the app was working for years and I had no issues like this before, so I assume there is a bug which was introduced at some point after 10.11.1.
I have 10k MAU and around 100 users face this issue now.
AFAIK I can't just downgrade realm version since you have some internal database format or something which could be changed over the version change and it's not recommended to downgrade since it can lead to the issues for the users, right?
Hi @cmelchior we have around 100 users that try to start the app that crashes shortly after launch. Even though it's 1% of users they try to launch several more times and then go to the Store to leave a 1* review which negatively impacts the app rating.
That's a pity to hear that you are not in control here. Could you elaborate more on "retry the operation"? I am not an Android guy but it sounds like a complex task to catch an exception in a thread that we do not control to prevent a crash. Then, we will need to somehow understand which one of the ongoing operations caused the crash which again could be a complex task to achieve.
I hope we will be able to resolve this situation with your help. As @SergeyTrukhachev mentioned we did not have this issue on a previous version and the iOS version works pretty much reliably. If that's impossible on the newest Android Realm version is there a rollback solution to downgrade to the old version we were using?
Hi @SergeyTrukhachev. We haven't touched the okhttp implementation between these versions. Could you try to elaborate on how your resolved dependencies have changed when you upgraded across Realm, AGP, Gradle, etc. This could help understand if the version of okhttp or other libraries have changed transitively.
Also, are there any patterns in Android versions, etc. in your crashlytics reports?
@rorbech this issue just disappeared by itself and I don't see it happening for the last 5-6 weeks. The ticket can be closed.