isar / isar/hive

'Invalid argument, errno = 22' when calling .open()

Open
#1,235 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

I'm receiving the following error when trying to open a box. I haven't been able to find any indication on why this would fail (it's happening to about 5% of users).

> Uncaught Platform Error: FileSystemException: read failed, path = '/var/mobile/Containers/Data/Application/D2B812D0-C5B0-45CB-9789-4D0D614B61A2/Documents/graphqlclientstore.hive' (OS Error: Invalid argument, errno = 22)

Full stack trace:

> FileSystemException: FileSystemException: read failed, path = '/var/mobile/Containers/Data/Application/D2B812D0-C5B0-45CB-9789-4D0D614B61A2/Documents/graphqlclientstore.hive' (OS Error: Invalid argument, errno = 22)
File "common.dart", line 42, in _checkForErrorResponse
File "file_impl.dart", line 740, in _RandomAccessFile.read.
File "zone.dart", line 1406, in _rootRunUnary
File ""
File "frame_io_helper.dart", line 41, in FrameIoHelper.framesFromFile
File ""
File "storage_backend_vm.dart", line 86, in StorageBackendVm.initialize
File ""
File "hive_impl.dart", line 111, in HiveImpl._openBox
File ""
File "hive_impl.dart", line 142, in HiveImpl.openBox
File ""
File "hive_store.dart", line 41, in HiveStore.openBox
File ""
File "hive_store.dart", line 52, in HiveStore.open

Potentially relevant information. We're seeing another Hive error:
- `(OS Error: Cannot allocate memory, errno = 12)`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the reported failure through storage_backend_vm.dart, hive_impl.dart, and the _RandomAccessFile.read stack frame. Investigate the intermittent iOS FileSystemException with errno 22 and the related memory-allocation error; done requires identifying a reproducible cause and defining verified behavior for opening the box.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.