-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Crash: LevelDB not created for Firestore with large data set #4333
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
Comments
@urosk Thanks for your report and sorry for your troubles! Do you know if this happens on a single device, or is this happening across multiple devices? Furthermore, does the issue persist if you manually delete the LevelDB files (or invoke |
One more follow up: Would it also be possible for you to send us the LevelDB files that are causing these problems? If it is possible, you can reach me at mrschmidt(at)google.com. |
@schmidt-sebastian I tested it on a physical device and a couple of simulators, same issue. Let me know if you need any further info. |
This sounds scary. Is there a possibility your can share a small reproduction with us? I also want to understand your previous statements more. You said that this might be influenced by the complexity and size of your dataset. Are you referring to the size and complexity of the size of your dataset on the backend? Or is this related to size of your data immediately before deletion? We believe this might also be related to #4269, so we would like to prioritize a fix for this. |
I mean that the Firestore database, which is causing issues with creating the on-device LevelDB, is populated by quite a lot of data and we have several levels of nesting of data structures. I don't know if that affects levelDB initialization in any way, but I assumed it somehow does, since the issue doesn't happen on an empty Firestore database. I can just run the following queries from the Firestore tutorial:
... and it fails to create the LevelDB on the populated Firestore, and succeeds on an empty Firestore (even if the data the query is requesting is not present in either). I can try to recreate a test Firestore which causes this issue and grant you access, so you can debug this easier. |
We've had no luck reproducing this. The contents of the database on the Firestore server should have no impact on LevelDB initialization. Does this reproduce in a clean Xcode project but re-using the Another alternative would be to just zip up your whole Xcode workspace and share that. You could share that temporarily via Google Drive or similar. |
Turns out it's not a Firestore bug. The issue was in an SQLite library which is apparently messing with the documents folder. Disabling the library fixed the issue. Sorry for the false alarm. |
This is perhaps another argument for resolving #843. |
I doubt this will be helpful - but The SQLite library was iterating over the documents folder and deleting all files which contained the name of the SQL database in their filename. And by coincidence, it also pattern matched some firestore files. So yeah, I guess the takeaway is that a lot of things (programmer errors) can go wrong in the Documents folder. |
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
When connecting to a specific Firestore database, the Firestore iOS SDK fails to create a local LevelDB database after a simple read from the Firestore is attempted. This causes an exception to be thrown by Firestore (app crashes) within ~1 minute, I assume when garbage collection runs the next time.
When attempting the same read from an empty Firestore (by swapping GoogleService-Info.plist), the database is correctly created.
If I disable persistence, the crash does not occur.
It looks like LevelDB intialization fails due to something specific to our Firestore. I suspect the complexity and size of our data set might be causing this issue.
Steps to reproduce:
The following exception is thrown ~1 minute after the read attempt:
When observing the file system during the read, I can see the database file created, and instantly deleted, so I assume something goes wrong during LevelDB initialization.
It doesn't matter if the data I'm attempting to read is actually in the DB, the result is the same. On the problematic Firestore, the LevelDB files are not created, and on an empty Firestore, the LevelDB files are correctly created
We already have a working Android version of our app, which does not exhibit this issue, so it leads me to believe that this might be iOS SDK specific.
Stack trace:
Relevant Code:
The text was updated successfully, but these errors were encountered: