Realms.Exceptions.RealmFileAccessErrorException: Unable to open a realm at path
See original GitHub issueGoals
Reliable realm database creation.
Expected Results
Realm instance.
Actual Results
Realms.Exceptions.RealmFileAccessErrorException: ‘Unable to open a realm at path ‘C:\Users\Václav\AppData\Local\Packages\7539ef42-e9e8-4e55-8c45-547c7a6ee489_v1yjhd5ekz562\LocalCache\realmtest.realm.management’: make_dir() failed: No such file or directory.’
Steps to Reproduce
Simple project for bug reproduction: https://1drv.ms/u/s!AlFEHk1e5ZDCoL1NodRClQwLeQdO6A
Code Sample
class RealmEntity : RealmObject {
[PrimaryKey]
public long Id { get; set; }
}
readonly static RealmConfiguration config = new RealmConfiguration(Path.Combine(ApplicationData.Current.LocalCacheFolder.Path, "realmtest.realm")) {
SchemaVersion = 1,
ObjectClasses = new Type[] { typeof(RealmEntity) },
ShouldDeleteIfMigrationNeeded = true
};
async void Page_Loaded(object sender, RoutedEventArgs e) {
using (var realm = await Realm.GetInstanceAsync(config)) {
}
}
Version of Realm and Tooling
- Client NuGet package version: 2.2.0
- Client OS & Version: Windows 10 version 1709 (build 16299.248)
Hint
I think (but I cannot be sure) that instance creation fails because of lack of UTF-8 support. The directory path contains non-ascii characters. I can reproduce this issue only on user accounts with non-ascii characters in the profile directory path.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
RealmFileException: Unable to open a realm at path #7301
I am running into this issue on Android(The app is ReactNative), iOS works fine. We get the following exception. This is happening mostly...
Read more >Unable to open a realm at path
I tried to open the realm file using Realm's browser app and the file does not open anymore. It has now new permissions:...
Read more >Unable to open a realm at path
Realms.Exceptions.RealmFileAccessErrorException: Unable to open a realm at path.
Read more >Unable to open a realm at path in Xamarin forms
I'm reading data from remote mongodb realm which sync's to my local realm, but it seems I can't read from my local realm...
Read more >Realm Xamarin 2.0.0
Realm Xamarin is the first database built for mobile. An alternative to SQLite and ORMs that's fast, easy to use, and open source....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I was hoping to do a point release this week.
This is actually a very serious issue, since
realm-dotnet
cannot be reliably used with UWP apps that run sandboxed. It is very likely that user’s profile folder contains non-ascii characters. It looks like the issue resides at realm-core’s file.cpp where_mkdir
function is used and_wmkdir
should be used instead. I’m not experienced in C++, but I assume that it cannot be safely switched to use_wmkdir
because the same core is compiled for multiple platforms.