Skip to content

Bad state: failed to create store: Cannot open store: another store #703

Open
@centy

Description

@centy

Build info

  • objectbox version:"4.0.3"
  • Flutter/Dart version: Flutter: 3.27.0 Dart SDK version: 3.6.0
  • Build OS: [Windows 10 ]

Steps to reproduce

Getting such callstack on Crashlitics.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: failed to create store: Cannot open store: another store is still open using the same path: "/data/data/com.gst.color.numbers.pixyfy/app_flutter/objectbox" (OBX_ERROR code 10001)
at ObjectBoxNativeError.throwMapped(helpers.dart:74)
at .throwLatestNativeError(helpers.dart:54)
at .checkObxPtr(helpers.dart:31)
at Store._checkStorePointer(store.dart:451)
at .new Store(store.dart:274)
at .openStore(objectbox.g.dart:271)
at PictureInfoRepository.performOpen(picture_info_repository.dart:164)

We are initializing DB in main functon.

Scerario look more less like this:

  1. User start app and it works
  2. App show ad
  3. Ad became closed and app is back again --> database is locked

I can not reproduce that, some additional conditions must occurs. This what we see in crashlitics

Expected behavior

Do not crash or some workaround

Actual behavior

App not starting

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions