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

App is crashing due from RealmFileException "access_control.write.mx" does not exist. #7002

Closed
babramovitch opened this issue Jul 23, 2020 · 3 comments

Comments

@babramovitch
Copy link

babramovitch commented Jul 23, 2020

Since upgrading Realm to 6.1.0 I've been seeing a large quantity of crashes saying the "access_control.write.mx" file does not exist. It's happening hundreds of times.

At times I am deleting realm and recreating a new one using Realm.deleteRealm(realmConfig), and the logs do show that sometimes Realm is open when this happens, at which point things are restarted to close any other realms so it can delete it on the next pass.

In my personal testing, deleting realm as well as attempting to delete it while open and restarting the app if it fails and then deleting it, all works, and was working like this for quite awhile (>~1 year?). I noticed this new crash with Realm 6.1.0, it was working on 5.11.0 on prior.

I have not compacted my Realm. It is not encrypted.

Nearly all of these crashes seem to be happening in my services (when a push notification is received) or in broadcast receivers (when scheduled alarms execute)

Some of the crashes (but not all, maybe 1/10?) have logs attached to them which indicated a problem with a Realm Migration (but it is there) so it's possible some upgrades are failing for some reason sometimes, but if that happens it would then delete and recreate the realm anyway, and thats probably when the file goes missing somehow?

Is there a new bug that is causing this file to suddenly go missing with a delete or a bad delete?

I'm trying to get more logging in but it might take awhile.

Actual Results

Caused by io.realm.exceptions.RealmFileException: Directory at path '/data/data/com./files/.realm.management/access_control.write.mx' does not exist. (open("/data/data/com./files/.realm.management/access_control.write.mx") failed: No such file or directory Path: /data/data/com./files/.realm.management/access_control.write.mx
Exception backtrace:
) (/data/data/com./files/.realm.management/access_control.write.mx) in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(OsSharedRealm.java)
at io.realm.internal.OsSharedRealm.(OsSharedRealm.java:171)
at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:241)
at io.realm.BaseRealm.(BaseRealm.java:136)
at io.realm.BaseRealm.(BaseRealm.java:103)
at io.realm.Realm.(Realm.java:163)
at io.realm.Realm.createInstance(Realm.java:499)
at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:360)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:290)
at io.realm.Realm.getDefaultInstance(Realm.java:407)
at com..getDefaultRealmInstance(.java:272)
at com..getRealm(.java:253)
at com..common.data.threadrepo.ThreadLocalSource.getRealm(ThreadLocalSource.kt:645)
at com..common.data.threadrepo.ThreadLocalSource.getUnreadThreadCount(ThreadLocalSource.kt:581)
at com..common.data.threadrepo.ThreadRepo.getUnreadThreadCount(ThreadRepo.kt:116)
at com..receiver.UnreadMessageReminderReceiver.displayNotificationIfUnreadMessages(UnreadMessageReminderReceiver.java:40)
at com..receiver.UnreadMessageReminderReceiver.onReceive(UnreadMessageReminderReceiver.java:31)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3989)
at android.app.ActivityThread.access$1500(ActivityThread.java:268)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7811)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

Steps & Code to Reproduce

Cannot reproduce

Version of Realm and tooling

Realm version(s): 6.1.0

Realm Sync feature enabled: No

Android Studio version: 3.6.3

Android Build Tools version: 28.0.3

Gradle version: 5.4.1

Which Android version and device(s):

All sorts of devices and OS. Firebase shows 7.0 -> 10 and these are some of the devices below

Galaxy S8
Galaxy S10
Pixel 2
Moto Z4

@edualonso
Copy link
Contributor

Looks very similar to #5634

See comments:
#5634 (comment)
#5634 (comment)

We need as much information and ways to reproduce the error as possible, especially regarding background services. Could you provide a consistent way to reproduce this or an example project?

@babramovitch
Copy link
Author

I can't reproduce it, I've spent hours trying all sorts of bizarre conditions I can think of happening in an upgrade flow and a service. I'll spend some more time, but don't get your hopes up.

It is blocking critically important notifications though.

@edualonso
Copy link
Contributor

Closing ticket due to inactivity. Unfortunately, we cannot do anything without a solid repro case - a sample project would help greatly.

@sync-by-unito sync-by-unito bot reopened this Oct 23, 2020
@sync-by-unito sync-by-unito bot closed this as completed Jan 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 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

2 participants