-
Notifications
You must be signed in to change notification settings - Fork 306
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
FileCorruptException: Corrupt DB, min key size violated: 0 #1090
Comments
Thanks for reporting! I guess this is on Android devices only? Anyhow, it may be possible to detect issues and salvage the database file using some If that won't work the last resort is to delete the database file. The exception will happen on the first read/write access, e.g. put or get call or query find. Edit: it seems only on the affected box, not any box. See below. |
Thanks for the reply! Yeah, we're only observing this on Android. The way we're handling database corruptions now is that upon building the default store, we're catching DbExceptions and trying to recover from that like so:
This works fine for corruption issues on initialization. Now if I understand correctly, adding the extra validations on open linked above should also help us catch the corruption issues happening on specific boxes. If these issues are not detected on startup with the extra validations, then we should be handling this exception on the first read/write access where this happens (query x -> exception -> close the store -> delete/try to use a previous snapshot -> rebuild the store) |
As you can see in the API docs |
Hello @greenrobot-team and @greenrobot ! I want to let you know that I have the same issue here for one of our user's database:
I added the call
Now I wonder if not all BoxStores are checked by However How can the error be avoided for future users? Is there any other way to fix the issue apart from deleting the database file? I still have a copy of the database, so I can test any solutions you provide. (For privacy reasons I unfortunately can not share the file...) |
@sarn0ld Do you know which ObjectBox version created the DB file? May we assume that the current ObjectBox version fails with the same error on this file? It's a pity that we cannot access the file. Would some NDA or the likes help? |
I don't know which version created the file in the beginning, but the error occured at the clientside with '3.2.1'. I will ask the customer whether a NDA is ok and get back to you when i got an answer. |
@greenrobot I'm happy to inform you that the customer is okay with an NDA (if I'm deleting all personal content from the working box stores). I prepared a NDA. How can I reach you? |
Hi, this is Markus. You can reach me at "my first name" at objectbox. IO |
@sarn0ld I think I did not receive anything. Can you still share it? |
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue. |
To also mention this here, we have released |
I have the same problem and I put the version 3.7.0 with validateOnOpen(ValidateOnOpenMode.Full) and it says: |
Describe the bug
We sporadically receive complaints from users, upon checking logs, queries on specific boxes seem to be throwing a "FileCorruptException: Corrupt DB, min key size violated: 0". While all other queries work fine, I just need to understand under what circumstance this exception gets thrown and how best to go about dealing with the issue as I couldn't find any documentation about this specific exception and couldn't find a replication scenario.
Basic info (please complete the following information):
Code
No specific area where this happens, but one of the examples is as follows:
Logs, stack traces
The text was updated successfully, but these errors were encountered: