firebase / firebase/firebase-ios-sdk

FIRESTORE INTERNAL ASSERTION FAILED: Failed to open DB

Open
#5,423 57 comments 15 reactions 0 assignees View on GitHub
api: firestore needs-attention
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 14h
Merged PRs (30d)
72

Description

### [REQUIRED] Step 1: Describe your environment

* Xcode version: 11.4.1
* Firebase SDK version: 6.21.0
* Firebase Component: Firestore
* Component version: 6.21.0
* Installation method: CocoaPods

### [REQUIRED] Step 2: Describe the problem

My app is crashing with a fatal exception due to Firestore.

I know several of these crashes has been reported before but since they are locked I could not comment on them.

So far this issue is only happening in production but it's happening in about 1% of all cases (about 2k crashes so far) so it's a pretty big problem for us now.

```
Fatal Exception: NSInternalInconsistencyException
FIRESTORE INTERNAL ASSERTION FAILED: Failed to open DB: Internal: Failed to open LevelDB database at /var/mobile/Containers/Data/Application/2211CDC3-4C78-4450-86AE-A1AC24D902BD/Library/Application Support/firestore/__FIRAPP_DEFAULT/eneco-360/main: LevelDB error: IO error: /var/mobile/Containers/Data/Application/2211CDC3-4C78-4450-86AE-A1AC24D902BD/Library/Application Support/firestore/__FIRAPP_DEFAULT/eneco-360/main/LOCK: Operation not permitted (expected created.ok())
```

```
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1acd22a48 __exceptionPreprocess
1 libobjc.A.dylib 0x1aca49fa4 objc_exception_throw
2 CoreFoundation 0x1acc24e88 +[_CFXNotificationTokenRegistration keyCallbacks]
3 Foundation 0x1ad0a9044 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
4 Eneco 0x100581828 firebase::firestore::util::ObjcThrowHandler(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string, std::__1::allocator > const&) + 59 (exception_apple.mm:59)
5 Eneco 0x1005814dc firebase::firestore::util::Throw(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string, std::__1::allocator > const&) + 90 (exception.cc:90)
6 Eneco 0x1005cc7d0 firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string, std::__1::allocator > const&, char const*) + 42 (hard_assert.cc:42)
7 Eneco 0x1005cc894 firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string, std::__1::allocator > const&, char const*) + 49 (hard_assert.cc:49)
8 Eneco 0x1005a1a30 firebase::firestore::core::FirestoreClient::Initialize(firebase::firestore::auth::User const&, firebase::firestore::api::Settings const&) + 177 (firestore_client.cc:177)
9 Eneco 0x100562724 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function const&) + 957 (atomic:957)
10 Eneco 0x100582854 firebase::firestore::util::internal::DispatchAsync(NSObject*, std::__1::function&&)::$_0::__invoke(void*)
11 libdispatch.dylib 0x1ac9ef184 _dispatch_client_callout
12 libdispatch.dylib 0x1ac9cc710 _dispatch_lane_serial_drain$VARIANT$armv81
13 libdispatch.dylib 0x1ac9cd128 _dispatch_lane_invoke$VARIANT$armv81
14 libdispatch.dylib 0x1ac9d643c _dispatch_workloop_worker_thread
15 libsystem_pthread.dylib 0x1aca3eb88 _pthread_wqthread
16 libsystem_pthread.dylib 0x1aca41760 start_wqthread
```

image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.