You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
when app restarted,if the db file is corrupted,BoxStore nativeCreate function will crash has no throwable! #865
hello,i need a throwable when the db file is corrupted that i can delete the db file and recreate it!but now there is not throwable can catch when the boxstore build,and the app will crash all the time!
andriod 8.1
there is the error log,i have the corrupted db files if you need.
my device was runing all the time with power adapter and no battery,so if the power shutdown,there will can make the db file corrupted;
And yes, the DB files could be very interesting to check. Can you attach them or do you prefer to send, e.g. by mail?
Which ObjectBox version were you running when the issue occurred?
PS.: ObjectBox builds upon mechanisms that should never corrupt any db files. If you turn off the device in the midst of writing a new transaction, it will have a consistent data view of the state before the (aborted) transaction.
Thanks for the files! I'm seeing a "No DB catalog present" message when I try to open the db file. This tells me that some very basic meta information seems unavailable in the file. Can you completely rule out that this file was not overwritten by something else? Are you 100% sure?
this db file is copy from the device,and i have never edit it.and the device running all the time,somtimes that will maybe abnormal shutdown.i guess that the reason of db corrupted probability.
Btw, in the given file, I see 8 entries representing entities, but no meta info...
The thing is even an abnormal shutdown should never result in this file. Maybe if the OS / file system does something wrong (e.g. breaking fsync semantics). Did you find a way to reproduce this? Is this limited to a specific device?
I encountered the same problem.
I tried to write a loop to add data to the objectbox all the time, and then power off my device, there is a chance to reproduce the situation of db corrupted. The specific performance is that the data can be read from the objectbox, but it crashes when I write
Android version:8.1
involved device is Sunrise x1600(Produced by Horizon)
objectbox‘s db file address is default,in /data/data/.../files/objectbox/objectbox/
You can check the corrupted db file I tested。
the testing process is as mentioned above,the difference is that some entities will crash when I execute findAll, not just add
It might be worth contacting the support of the device manufactures; especially Horizon. This was never reported before, and given the reports lately, it seems likely that something is wrong with the file system on those devices. Do you have a chance to report this (or have a link)?
Version 2.7.0 added some additional checks to detect inconsistencies that can be caused by broken file systems like it seems the case here (e.g. fsync'ed data is out-of-order). A minimal check is now done always, causing the new FileCorruptException if it fails. There's more related features, e.g. validateOnOpen settings in BoxStoreBuilder, validate() in BoxStore. There's also a new BoxStoreBuilder option to use the previous snapshot, which may restore data. For now best check the JavaDocs in the sources.
Please let us know if this is helpful and catches most (all?) error caused on that devices... Thank you.
Activity
greenrobot commentedon Jun 10, 2020
Do you have any information on the crash? E.g. start by check the logs.
Also, do you have any info on how the DB file got corrupted?
PS.: We're not aware of any issue resulting in a crash/corruption, so I'm very curious...
lakehubo commentedon Jun 11, 2020
there is the error log,i have the corrupted db files if you need.
my device was runing all the time with power adapter and no battery,so if the power shutdown,there will can make the db file corrupted;
greenrobot commentedon Jun 11, 2020
Thank you.
And yes, the DB files could be very interesting to check. Can you attach them or do you prefer to send, e.g. by mail?
Which ObjectBox version were you running when the issue occurred?
PS.: ObjectBox builds upon mechanisms that should never corrupt any db files. If you turn off the device in the midst of writing a new transaction, it will have a consistent data view of the state before the (aborted) transaction.
lakehubo commentedon Jun 11, 2020
ObjectBoxTestDemo.zip
greenrobot commentedon Jun 11, 2020
Thanks for the files! I'm seeing a "No DB catalog present" message when I try to open the db file. This tells me that some very basic meta information seems unavailable in the file. Can you completely rule out that this file was not overwritten by something else? Are you 100% sure?
lakehubo commentedon Jun 11, 2020
this db file is copy from the device,and i have never edit it.and the device running all the time,somtimes that will maybe abnormal shutdown.i guess that the reason of db corrupted probability.
lakehubo commentedon Jun 11, 2020
Can you thorw these error meesage?that i can delete the corrupted db file.
Thanks so much.
greenrobot commentedon Jun 11, 2020
I'll investigate...
Btw, in the given file, I see 8 entries representing entities, but no meta info...
The thing is even an abnormal shutdown should never result in this file. Maybe if the OS / file system does something wrong (e.g. breaking fsync semantics). Did you find a way to reproduce this? Is this limited to a specific device?
lakehubo commentedon Jun 12, 2020
it happened small chance and fatal, i have no way to reproduce this.but it happend on a specified device,Rk3399 development board with android8.1.
RRRaymon commentedon Jun 17, 2020
I encountered the same problem.
I tried to write a loop to add data to the objectbox all the time, and then power off my device, there is a chance to reproduce the situation of db corrupted. The specific performance is that the data can be read from the objectbox, but it crashes when I write
greenrobot commentedon Jun 18, 2020
@RRRaymon can you share the involved device and Android version? Also, was it on internal storage? You did not have I/O errors otherwise on that disk?
RRRaymon commentedon Jun 19, 2020
Android version:8.1
involved device is Sunrise x1600(Produced by Horizon)
objectbox‘s db file address is default,in
/data/data/.../files/objectbox/objectbox/You can check the corrupted db file I tested。
the testing process is as mentioned above,the difference is that
some entitieswill crash when I executefindAll, not justaddobjectbox.zip
hzqhzqhzq1 commentedon Jun 30, 2020
i hava the same problem,the same device producted by Horizon
greenrobot commentedon Jul 1, 2020
It might be worth contacting the support of the device manufactures; especially Horizon. This was never reported before, and given the reports lately, it seems likely that something is wrong with the file system on those devices. Do you have a chance to report this (or have a link)?
greenrobot commentedon Jul 28, 2020
Quick update: we'll release new new version addressing this very soon. It should detect some common cases. Details will follow in this thread.
greenrobot commentedon Jul 30, 2020
Version 2.7.0 added some additional checks to detect inconsistencies that can be caused by broken file systems like it seems the case here (e.g. fsync'ed data is out-of-order). A minimal check is now done always, causing the new FileCorruptException if it fails. There's more related features, e.g. validateOnOpen settings in BoxStoreBuilder, validate() in BoxStore. There's also a new BoxStoreBuilder option to use the previous snapshot, which may restore data. For now best check the JavaDocs in the sources.
Please let us know if this is helpful and catches most (all?) error caused on that devices... Thank you.