objectbox-swift: ObjectBox.ObjectBoxError.storageGeneral(message: "Could not open env for DB (12)"

iOS 13.1.3, XCode 11.0. Works with iOS simulator on MacOS.

Error is throwing on initialization of store: try! Store(directoryPath: directory.path)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Fixed internally (https://github.com/objectbox/objectbox-swift-spec-staging/releases/tag/v1.3.x); official release coming very soon.

We’ll look into it asap; we have an idea about the cause and will verify this.

I still get this issue, however it ONLY occurs intermittently - perhaps 5% of launches. Latest objectbox version, latest swift, latest xcode etc. I tried catching the error and then trying to create the store again, but error 12 gets thrown every time for that launch. Also, it’s not build-dependent. I verified that by building on my iOS device once, not properly handling the exception, and then closing and re-opening the app over and over. About 5% of the time I opened it, the error would throw as indicated by the app crashing immediately.

Hi,

I have exactly the same issue, I am using the latest release v1.2.0 and running on iOS 13.4.

My app sometimes crashes when I call “try Store(directoryPath: directory.path)”, therefore I downloaded this repo to run the example and the issues can still be reproduced.

Please see the full error message as following: Fatal error: ‘try!’ expression unexpectedly raised an error: ObjectBox.ObjectBoxError.storageGeneral(message: “Could not open env for DB (12)”): file /Users/garylin/Documents/objectbox-swift-master/Example/NotesExample-iOS/Services.swift, line 13

Reproduction steps: Keep close and reopen the sample app, and it will crash at some point. This issue appears randomly.

Thanks.