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

Cannot open .realm file on exFAT and FAT32 drives #6508

Closed
gangsports opened this issue May 15, 2020 · 6 comments · Fixed by realm/realm-core#3733
Closed

Cannot open .realm file on exFAT and FAT32 drives #6508

gangsports opened this issue May 15, 2020 · 6 comments · Fixed by realm/realm-core#3733

Comments

@gangsports
Copy link

gangsports commented May 15, 2020

Goals

Open a saved .realm file on an exFAT drive in Realm Studio

Expected Results

The file is opened as expected

Actual Results

Realm Studio reports an error

fcntl() inside prealloc() failed allocating 1184 bytes, new_size=1184, cur_size=0, allocated_size=0, event: Operation not supported

Steps to Reproduce

1. Create a sample CSV file has the following content and save as sample.csv on an APFS drive (In my case, it was my Macintosh HD on my MBP)

T1,T2,T3
one,two,three

2. Use Realm Studio (Version 3.11.0 (3.11.0.719)) > Create Realm from > CSV and select 'sample.csv' and save as sample.realm

3. Open sample.realm on APFS and it works as expected

4. Move sample.realm to an external exFAT drive and use Realm Studio to open it again

5. Ream Studio reports the following error

fcntl() inside prealloc() failed allocating 1184 bytes, new_size=1184, cur_size=0, allocated_size=0, event: Operation not supported

Code Sample

Above replication does not require a sample code, but the same issue happens to our OS X application too when it tries to read a saved Realm file on exFAT or FAT32 drives.

Version of Realm and Tooling

Realm framework version: 4.4.1

Realm Object Server version: ?

Xcode version: 11.3.1

iOS/OSX version: ?

Dependency manager + version: ?

@tgoyne
Copy link
Member

tgoyne commented May 18, 2020

@ironage This sounds like File::prealloc() is failing to fall back to manual prealloc when the filesystem doesn't support it. I assigned you since I think you were the one to write that bit of code, but just let me know if you won't be able to get this.

@tgoyne tgoyne added the T-Bug label May 18, 2020
@gangsports
Copy link
Author

Thanks for checking this!
When we say filesystem doesn't support it, did the it refer to File::prealloc() or RealmCocoa?

Appreciate your time.

@tgoyne
Copy link
Member

tgoyne commented May 18, 2020

Prealloc. We use a APFS feature to expand the Realm file when needed, and just aren't properly falling back to the non-APFS case.

@gangsports
Copy link
Author

Thanks for your reply. So, is RealmCocoa supposed to support non-APFS? For example, exFAT?
This is quite important for us to understand the limitation of our current project.

Really looking forward to your reply, and thanks.

@tgoyne
Copy link
Member

tgoyne commented May 18, 2020

It is supposed to work and the fact that it doesn't in a bug which should be simple to fix.

@gangsports
Copy link
Author

This is awesome!
I will forward the information back to my team. Looking forward to the fix!

Thank you very much for the quick and helpful replies!

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

Successfully merging a pull request may close this issue.

3 participants