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

RealmException: posix_fallocate() failed #3482

Closed
peachypixels opened this issue Nov 22, 2023 · 9 comments · Fixed by #3502
Closed

RealmException: posix_fallocate() failed #3482

peachypixels opened this issue Nov 22, 2023 · 9 comments · Fixed by #3502
Assignees

Comments

@peachypixels
Copy link

peachypixels commented Nov 22, 2023

What happened?

Hello!

I've been using Realm (.Net) 11.5.0 in Unity for months now with no issues (Windows Editor & Android Builds)

After upgrading to 11.6.1 it's still working in the Editor, but the attached exception is thrown when retrieving a Realm instance on Android.

The lock file is created, but the Realm (and other associated files) are not. This occurs whether opening an existing Realm or creating a new.

Unity Version: 2022.3.13f1
Android Version: 10 (ARM64 \ IL2CPP)

Repro steps

See attached code.

Version

11.6.1

What Atlas Services are you using?

Local Database only

What type of application is this?

Unity

Client OS and version

Android 10 (ARM64 \ IL2CPP)

Code snippets

RealmConfiguration config = new RealmConfiguration([file]);
config.EncryptionKey = [key];
config.Schema = new Type[] { typeof([type]) };
config.FallbackPipePath = [path];

Realm realm = Realm.GetInstance(config);

Stacktrace of the exception/crash you're getting

RealmException: posix_fallocate() failed: Operation not supported on transport endpoint: Operation not supported on transport endpoint (95)
Realms.NativeException.ThrowIfNecessary ()
Realms.SharedRealmHandle.Open (Realms.Native.Configuration configuration)
Realms.RealmConfiguration.CreateHandle (Realms.Native.Configuration& configuration)
Realms.RealmConfigurationBase.CreateRealm ()

Relevant log output

No response

@fealebenpae
Copy link
Member

Hey @peachypixels. Thanks for reporting this. Can you reproduce it on the Android Emulator, or is it a specific device that exhibits the error?

@peachypixels
Copy link
Author

Hi @fealebenpae. Thanks for the prompt reply. Sorry I'm not using the Android Emulator, just the Unity Editor and on-device builds (built with Unity Build Automation). I will try the build on a second Android device and report back.

@peachypixels
Copy link
Author

Hi @fealebenpae. Just tried on a completely different Android (8) device and the exact same issue. As far as I can tell, there are no changes with any of my Realm calls between the last build (using 11.5.0 that worked) and this build (using 11.6.1)

I'll try and add some extra logging to see if it helps, but I'm beginning to think it's a wider issue with 11.6.1 and Android.

@fealebenpae
Copy link
Member

Can you tell me what device models you’re running on and where on the filesystem the realm file is stored? I want to figure out if it has anything to do with the filesystem, because our automated tests didn’t turn up anything on Emulator or the devices we have access to.

@peachypixels
Copy link
Author

The devices were a OnePlus7 (Android 10) & Lenovo Tab4 (Android 8). The Unity project install location is currently Prefer External and both devices have no extra storage, so it must be using internal.

Both devices are writing data to... /storage/emulated/0/Android/data/[bundle]/files/[etc]

Note... the OnePlus7 was originally failing to create the Realm, until the FallbackPipePath was defined (as outlined here)...

https://www.mongodb.com/community/forums/t/writing-to-android-persistent-storage-with-unity-throws-read-only-file-system-error/224093

@fealebenpae
Copy link
Member

Thanks for the extra details. I have an idea how we might fix this, but I would like to be able to reproduce first. I’ll update here once I have learned more.

@peachypixels
Copy link
Author

Ok, thanks for the update. I'm going to revert to 11.5.0 for now and will report back if this resolves the issue.

@peachypixels
Copy link
Author

peachypixels commented Nov 22, 2023

FYI. Reverting to 11.5.0 has resolved the issue on both devices. So it's almost definitely an 11.6.x issue.

@peachypixels
Copy link
Author

Thanks everyone!

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jan 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
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.

2 participants