hive icon indicating copy to clipboard operation
hive copied to clipboard

HiveError: This should not happen. Please open an issue on GitHub.

Open lastmeta opened this issue 4 years ago • 4 comments

Steps to Reproduce I guess somehow the database got corrupted or something? restarted my flutter app and got this error which I've never seen before.

Code sample

Launching lib\main.dart on sdk gphone x86 in debug mode...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:55854/cI-hT-LUhQA=/ws
W/FlutterJNI( 5792): FlutterJNI.loadLibrary called more than once
W/FlutterJNI( 5792): FlutterJNI.prefetchDefaultFontManager called more than once
I/ResourceExtractor( 5792): Found extracted resources res_timestamp-1-1648791585760
W/FlutterJNI( 5792): FlutterJNI.init called more than once
I/FLTFireBGExecutor( 5792): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
D/EGL_emulation( 5792): eglCreateContext: 0xec2e8a30: maj 2 min 0 rcv 2
D/EGL_emulation( 5792): eglCreateContext: 0xec2e0290: maj 2 min 0 rcv 2
D/HostConnection( 5792): HostConnection::get() New Host Connection established 0xec2e0300, tid 5860
D/HostConnection( 5792): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
D/EGL_emulation( 5792): eglMakeCurrent: 0xec2e0290: ver 2 0 (tinfo 0xb7b4e0f0) (first time)
D/PathProviderPlugin( 5792): Use TaskQueues.
I/FLTFireMsgService( 5792): FlutterFirebaseMessagingBackgroundService started!
I/flutter ( 5792): ----------------FIREBASE CRASHLYTICS----------------
I/flutter ( 5792): HiveError: This should not happen. Please open an issue on GitHub.
I/flutter ( 5792): #0      BinaryReaderImpl.readFrame
I/flutter ( 5792): #1      FrameHelper.framesFromBytes
I/flutter ( 5792): #2      FrameIoHelper.framesFromFile
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #3      StorageBackendVm.initialize
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #4      HiveImpl._openBox
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #5      HiveImpl.openBox
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #6      HiveInitializer.openAllBoxes
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #7      HiveInitializer.setUp
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #8      _LoadingState.setup
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): ----------------------------------------------------
I/flutter ( 5792): ----------------FIREBASE CRASHLYTICS----------------
I/flutter ( 5792): HiveError: This should not happen. Please open an issue on GitHub.
I/flutter ( 5792): #0      BinaryReaderImpl.readFrame
I/flutter ( 5792): #1      FrameHelper.framesFromBytes
I/flutter ( 5792): #2      FrameIoHelper.framesFromFile
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #3      StorageBackendVm.initialize
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #4      HiveImpl._openBox
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #5      HiveImpl.openBox
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #6      HiveInitializer.openAllBoxes
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #7      HiveInitializer.setUp
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): #8      _LoadingState.setup
I/flutter ( 5792): <asynchronous suspension>
I/flutter ( 5792): ----------------------------------------------------

Version

  • Platform: Android
  • Flutter version: Flutter 2.10.3
  • Hive version: 2.04
  • Dart: 2.16.1

lastmeta avatar Apr 01 '22 05:04 lastmeta

I have a similar bug :

This should not happen. Please open an issue on GitHub.
   #0      BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:250:7)
   #1      FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:21:26)
   #2      FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:42:12)
   <asynchronous suspension>
   #3      StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:86:11)
   <asynchronous suspension>
   #4      HiveImpl._openBox (package:hive/src/hive_impl.dart:111:9)
   <asynchronous suspension>
   #5      HiveImpl.openBox (package:hive/src/hive_impl.dart:139:12)
   <asynchronous suspension>

The problem appears when 2 flutter engines open the box in 2 different processes (i have an app running while a background service is opening the box). I think Hive cannot share same box ?

public-virtualys avatar Apr 01 '22 17:04 public-virtualys

yeah me too, any solution? cause i have to init flutter & open the box in background service, and this error appears

I have a similar bug :

This should not happen. Please open an issue on GitHub.
   #0      BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:250:7)
   #1      FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:21:26)
   #2      FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:42:12)
   <asynchronous suspension>
   #3      StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:86:11)
   <asynchronous suspension>
   #4      HiveImpl._openBox (package:hive/src/hive_impl.dart:111:9)
   <asynchronous suspension>
   #5      HiveImpl.openBox (package:hive/src/hive_impl.dart:139:12)
   <asynchronous suspension>

The problem appears when 2 flutter engines open the box in 2 different processes (i have an app running while a background service is opening the box). I think Hive cannot share same box ?

asfarul avatar Apr 03 '22 09:04 asfarul

The background service is running in a different app? I think if it is in the same app you can use the box if is already opened

ArielM24 avatar Apr 03 '22 16:04 ArielM24

It's the same app.

public-virtualys avatar Apr 04 '22 07:04 public-virtualys