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

Permission Denied on trying to open a realm in INTERNAL STORAGE #5142

Closed
vyashole opened this issue Aug 23, 2017 · 2 comments
Closed

Permission Denied on trying to open a realm in INTERNAL STORAGE #5142

vyashole opened this issue Aug 23, 2017 · 2 comments

Comments

@vyashole
Copy link

vyashole commented Aug 23, 2017

Goal

I want to investigate this crash.

Expected Results

Permission denied should not occur because my realm is in internal storage with the following config:

        Realm.init(this); //this is application context here
        realmConfig =  new RealmConfiguration.Builder().name("collect.realm").schemaVersion(21).migration(new Migration()).build();

Actual Results

Stacktrace

Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Permission denied in /Users/blakemeike/Working/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 94
       at io.realm.internal.SharedRealm.nativeGetSharedRealm(SourceFile)
       at io.realm.internal.SharedRealm.getInstance(SourceFile:211)
       at io.realm.internal.SharedRealm.getInstance(SourceFile:188)
       at io.realm.RealmCache.createRealmOrGetFromCache(SourceFile:124)
       at io.realm.Realm.getDefaultInstance(SourceFile:209)
       at com.socialcops.collect.plus.start.mainActivity.MainActivity.onCreate(SourceFile:68)
       at android.app.Activity.performCreate(Activity.java:6582)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2532)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2667)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)
       at android.os.Handler.dispatchMessage(Handler.java:111)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

Note: my proguard mapping file is configured to not include file names, that's why everything is SourceFile

Steps & Code to Reproduce

Never reproduced this manually. Received this stacktrace in our crash reporting tool. Appears to be happening only on Lenovo A7010a48 running Android 6.0. This crash happens when Realm.getDefaultInstance() is called from the onCreate() of my MainActivity, which means the app crashed on launch. init() happens in the Application class. The app is a single process application so there is probably no way for init() to go wrong.

Version of Realm and tooling

Realm version(s): 2.3.1

Realm sync feature enabled: no

Android Studio version: 2.3.3

Which Android version and device: Lenovo A7010a48 running Android 6.0

@cmelchior
Copy link
Contributor

Hi @adwaitv We have seen a number of bugs with vendors. Most likely it is a bug on that particular device. See e.g #3972 for a possible work-around.

Without further information and a way to reproduce it, I doubt there is much we can do about it, unfortunately 😢

I'll keep this open a little longer as @beeender might remember seeing this error elsewhere or have other ideas.

@beeender
Copy link
Contributor

Dup to #3972 without reproducing it, it is hard to tell why .... could be same reason with #3972 (comment)

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

3 participants