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

Required SETTINGS preface not received #7865

Closed
SergeyTrukhachev opened this issue Jan 4, 2024 · 5 comments
Closed

Required SETTINGS preface not received #7865

SergeyTrukhachev opened this issue Jan 4, 2024 · 5 comments

Comments

@SergeyTrukhachev
Copy link

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: ...

@cmelchior
Copy link
Contributor

This exception comes from OkHttp and indicates that the network connection was somehow not correct:

https://github.com/square/okhttp/blob/eb6c016f6f5a6fa789cb4d21636b83e0abab895d/okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Reader.kt#L75

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.

@SergeyTrukhachev
Copy link
Author

@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?

@cmelchior cmelchior reopened this Jan 5, 2024
@anton-plebanovich
Copy link

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.
image

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?

@rorbech
Copy link
Contributor

rorbech commented Jan 9, 2024

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?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jan 15, 2024
@SergeyTrukhachev
Copy link
Author

@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.

@github-actions github-actions bot added Needs-Attention and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Mar 1, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
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