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

Internal crash on OsJavaNetworkTransport.cpp #7864

Open
jhonnyinstacart opened this issue Jan 2, 2024 · 5 comments
Open

Internal crash on OsJavaNetworkTransport.cpp #7864

jhonnyinstacart opened this issue Jan 2, 2024 · 5 comments

Comments

@jhonnyinstacart
Copy link

How frequently does the bug occur?

Sometimes

Description

Sometimes when we try to access a realm it crashes our app, don´t really have much info per the stacktrace but hopefully it means something for you guys, our QA team says it happens from time to time.

Stacktrace & log output

Fatal Exception: java.lang.IllegalArgumentException: Illegal Argument: Invalid column key in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_objectstore_OsJavaNetworkTransport.cpp line 61
       at io.realm.internal.objectstore.OsJavaNetworkTransport.nativeHandleResponse(OsJavaNetworkTransport.java)
       at io.realm.internal.objectstore.OsJavaNetworkTransport.handleResponse(OsJavaNetworkTransport.java:98)
       at io.realm.internal.network.OkHttpNetworkTransport$1.run(OkHttpNetworkTransport.java:102)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:919)

Can you reproduce the bug?

Sometimes

Reproduction Steps

No response

Version

10.17.0

What Atlas App Services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

Android 10

Build environment

Android Studio version: Android Studio Hedgehog | 2023.1.1 Canary 15
Android Build Tools version: 33.0.2
Gradle version: 7.6.2

@cmelchior
Copy link
Contributor

Hmm, the crash is associated with HTTP requests going to App Services. The error message "Invalid column key" however is an internal crash saying that our association between model class properties and their underlying representation is no longer correct.

This is a bit weird, since Device Sync does not use the OsJavaNetworkTransport class, it uses its own Websocket connection.

Are you by any chance using Functions? And if yes, are you perhaps writing to the Realm using the result of the function response?

@jhonnyinstacart
Copy link
Author

mmm no I don't think so @cmelchior, we don't write at any time on our app, writes are even set to false on our device sync config, only reads are allowed, all writes are done by the sync SDK internally while syncing.

@rorbech
Copy link
Contributor

rorbech commented Jan 9, 2024

Hi @jhonnyinstacart. Could this somehow be related to testing scenarios of upgrading or downgrading the application? The user metadata is stored in an internal realm-file. The schema of this realm changed with 10.17.0, so ex. downgrading from that version to a prior one would require the user to login again, and some scenarios with user/authentication operations could maybe trigger the above error. Can you try to elaborate on the use cases that triggers this?

@jhonnyinstacart
Copy link
Author

I think you might be right @rorbech, thanks for the suggestion, we are still trying to come up with repro steps, no luck just yet, but independently can you guys make a fix for this based on your theory? the SDK should def not crash when upgrading or downgrading 🙏

@rorbech
Copy link
Contributor

rorbech commented Jan 15, 2024

Hi @jhonnyinstacart. I have tried replicating your issue by updating and downgrading across 10.16.2 and 10.17.0. Upgrading works, but downgrading is not possible because of an internal check in core that does not work as intended (realm/realm-core#7256). The work around for downgrading would be to delete the metadata Realm in $[SYNC-ROOT-DIRECTORY]/mongodb-realm/[APP-ID]/server-utility/metadata/ as part of the downgrade and would of course require logging in again.

Even with the very unfortunate issue of not being able to downgrade, I cannot provoke you crash, so please gather information on any use case leading up to the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants