Baseflow / Baseflow/flutter_cache_manager

ios sqflite DatabaseException "disk I/O error"

Open
#337 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
809
Forks
510
Avg merge
6m
Merged PRs (30d)
1

Description

## 🐛 Bug Report

Stacktrace:
```
DatabaseException(Error Domain=FMDatabase Code=6922 "disk I/O error" UserInfo={NSLocalizedDescription=disk I/O error}) sql 'DELETE FROM cacheObject WHERE _id IN ()' args []}. Error thrown null.
Non-fatal Exception: FlutterError
0 ??? 0x0 wrapDatabaseException + 11 (exception_impl.dart:11)
1 ??? 0x0 + 420 (database_mixin.dart:420)
2 ??? 0x0 synchronized + 33 (basic_lock.dart:33)
3 ??? 0x0 txnSynchronized + 346 (database_mixin.dart:346)
4 ??? 0x0 emptyCache + 149 (cache_store.dart:149)
5 ??? 0x0 (dart:async)
6 ??? 0x0 doLogout + 535 (loginbloc.dart:535)
7 ??? 0x0 + 238 (bloc.dart:238)
```

Happened only to one user, but 8 times in a row, in an iOS released app.
I add a [comment](https://github.com/tekartik/sqflite/issues/492#issuecomment-927640113) to [the same error](https://github.com/tekartik/sqflite/issues/492) in the sqflite repository

### Reproduction steps
Seems that erasing the cache this problem arose. But I wasn't able to reproduce.
From the analyics log I can say that happened when the user logged out, in that moment I erase the cache calling `CacheManager.emptyCache()`

### Configuration

### Output of `flutter --version`

- Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
- Framework • revision f4abaa0735 (3 months ago) • 2021-07-01 12:46:11 -0700
- Engine • revision 241c87ad80
- Tools • Dart 2.13.4

**Package version:** 2.1.2. I know it's a major release behind, but it doesn't seem this problem has been encountered searching for this issue in the repository, anyway, I'll upgrade the package and proceed to release a new version of the app.

**Platform:**
- iOS: 14.7.1

Contributor guide

Open the contributing guide

Research direction

The report points to CacheManager.emptyCache(), cache_store.dart:149, during logout, with the failing DELETE statement shown in the stack trace. Read that call and database_mixin.dart:420, then compare the referenced sqflite issue #492. Done requires identifying a reproducible cause and confirming that logout cache deletion no longer produces the iOS exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
databases, mobile-dev
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.