> On Aug 30, 2015, at 12:24 PM, Brendan Duddridge <
bren...@gmail.com> wrote:
>
> FDB_RESULT_NO_DB_HEADERS = -38,
> So I suspect then that there is some sort of database file corruption going on here.
Yeah, -38 is ForestDB giving up on opening a db because it can’t find the database ‘header’ (it’s actually at the end of the file.)
In theory, ForestDB should never be able to corrupt a database. The file is append-only, so even if a write fails, the previous header will still be found and the data from before that write will still be available. (Of course some external cause could still corrupt a file, like filesystem damage, or another process somehow overwriting the file.)
One possibility is if this file was created a long time ago — I ran into this recently trying to open a Couchbase Lite database from last year. At some point during development (before it went beta) ForestDB had an incompatible change in the db header format. But I don’t think anyone outside Couchbase was using Couchbase Lite with ForestDB back then. How old is this file?
The ForestDB engineers might want to have a look at the file, if possible.
—Jens