Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
4.5.1
-
None
Description
Refiled from: https://github.com/couchbase/couchbase-lite-ios/issues/1550
While debugging my code, I experienced a crash when deleting the database. I should also add that I wasn't able to reproduce it.
The incriminated code is the following:
couchbaseQueue.async { do { _ = try self.database.delete() } catch ...
This code should not crash and instead it should raise an exception (or in the Obj-C world, it should "return" an NSError).
This is the stack trace:
#7 0x0000000105f11953 in cbforest::error::throw(fdb_status) at CBForest/Error.cc:24 #8 0x0000000105f138f8 in cbforest::check(fdb_status) [inlined] at CBForest/Error.hh:59 #9 0x0000000105f138f1 in cbforest::Database::getKeyStore(std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >) const at CBForest/Database.cc:161 #10 0x0000000105f13c23 in cbforest::Database::updatePurgeCount() at CBForest/Database.cc:227 #11 0x0000000105f1355c in cbforest::Database::onCompact(unsigned int, char const*, fdb_doc_struct*, unsigned long long, unsigned long long) [inlined] at CBForest/Database.cc:405 #12 0x0000000105f1352a in cbforest::Database::compactionCallback(_fdb_file_handle*, unsigned int, char const*, fdb_doc_struct*, unsigned long long, unsigned long long, void*) at CBForest/Database.cc:385
And this is what I see in the console:
[FDB ERR] Error in UNLINK on a database file '.../couchbase.cblite2/db.forest.0', errno = 2: 'No such file or directory' 13:47:09.094‖ WARNING: ForestDB error: ForestDB handle is invalid (-30) {at FDBLogCallback:68} libc++abi.dylib: terminating with uncaught exception of type cbforest::error