Frequent SQLite errors
Describe the bug Intermittent SQLite errors (attempt to write a readonly database) To Reproduce
- ???
- Error occurs, app can no longer load any data from e621
Expected behavior The app functions normally
Screenshots
Platform
- Device: Fairphone 4
- OS: Android
- Version 13 (TKQ1.230127.002)
Logs
SHOUT | 09:34:40.020 | Flutter: SqliteException(1032): while executing statement, attempt to write a readonly database, attempt to write a readonly database (code 1032)
Causing statement: INSERT OR REPLACE INTO "DioCache" ("cacheKey", "date", "cacheControl", "content", "eTag", "headers", "priority", "requestDate", "responseDate", "url") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?), parameters: ccd600f9-37d4-5a5d-be39-170baf858b5d, 1723383280, max-age=300, must-revalidate, private, blob (48567 bytes), W/"b6baf91d9eeb2c5afcb373764108bac1", blob (1497 bytes), 1, 1723383279, 1723383280, https://e621.net/posts.json?page=7&limit&tags=score%3A%3E%3D20
╔ Data ════════════════════════════════════════════════════════════════════════════════════╗
║
║ SqliteException(1032): while executing statement, attempt to write a readonly database, attempt to write a readonly database (code 1032)
║ Causing statement: INSERT OR REPLACE INTO "DioCache" ("cacheKey", "date", "cacheControl", "content", "eTag", "headers", "priority", "requestDate", "responseDate", "url") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?), parameters: ccd600f9-37d4-5a5d-be39-170baf858b5d, 1723383280, max-age=300, must-revalidate, private, blob (48567 bytes), W/"b6baf91d9eeb2c5afcb373764108bac1", blob (1497 bytes), 1, 1723383279, 1723383280, https://e621.net/posts.json?page=7&limit&tags=score%3A%3E%3D20
║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
╔ Stacktrace ══════════════════════════════════════════════════════════════════════════════╗
║
║ package:sqlite3/src/implementation/exception.dart 75 throwException
║ package:sqlite3/src/implementation/statement.dart 109 StatementImplementation._execute
║ package:sqlite3/src/implementation/statement.dart 289 StatementImplementation.executeWith
║ package:sqlite3/src/statement.dart 72 CommonPreparedStatement.execute
║ package:drift/src/sqlite3/database.dart 149 Sqlite3Delegate.runWithArgsSync
║ package:drift/native.dart 332 _NativeDelegate.runInsert.<fn>
║ dart:async/future.dart 306 new Future.sync
║ package:drift/native.dart 331 _NativeDelegate.runInsert
║ package:drift/src/runtime/executor/helpers/engines.dart 105 _BaseExecutor.runInsert.<fn>
║ package:drift/src/runtime/executor/helpers/engines.dart 61 _BaseExecutor._synchronized
║ package:drift/src/runtime/executor/helpers/engines.dart 102 _BaseExecutor.runInsert
║ package:drift/src/runtime/api/connection.dart 103 DatabaseConnection.runInsert
║ package:drift/src/remote/server_impl.dart 155 ServerImplementation._runQuery
║ package:drift/src/remote/server_impl.dart 118 ServerImplementation._handleRequest.<fn>
║ package:drift/src/remote/communication.dart 165 DriftCommunication.setRequestHandler.<fn>
║ ===== asynchronous gap ===========================
║ package:drift/src/remote/communication.dart 113 DriftCommunication.request
║ package:drift/src/remote/client_impl.dart 97 _BaseExecutor._runRequest
║ package:drift/src/remote/client_impl.dart 124 _BaseExecutor.runInsert
║ package:drift/src/utils/lazy_database.dart 78 LazyDatabase.runInsert
║ package:drift/src/runtime/query_builder/statements/insert.dart 74 InsertStatement.insert.<fn>
║ package:drift/src/runtime/api/connection_user.dart 162 DatabaseConnectionUser.doWhenOpened.<fn>
║ package:drift/src/runtime/query_builder/statements/insert.dart 73 InsertStatement.insert
║ package:dio_cache_interceptor_db_store/src/store/database.dart 122 DioCacheDao.set
║ package:dio_cache_interceptor/src/dio_cache_interceptor.dart 225 DioCacheInterceptor._saveResponse
║ package:dio_cache_interceptor/src/dio_cache_interceptor.dart 102 DioCacheInterceptor.onResponse
║
║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
Additional context
Thank you for your issue. We are working on fixing this.
Also having an identical issue on android 14 samsung
exact same issue is still occurring on the latest release no less frequently.
I'm experiencing the same issue still. Same SqliteException(1032). It makes happens pretty much every screen change.
Same here. I think the app USED to work, and I don't THINK I've updated since then, though I'm not sure.
SHOUT | 21:52:57.059 | Flutter: SqliteException(1032): while executing statement, attempt to write a readonly database, attempt to write a readonly database (code 1032)
Causing statement: INSERT OR REPLACE INTO "DioCache" ("cacheKey", "date", "cacheControl", "content", "eTag", "headers", "priority", "requestDate", "responseDate", "url", "statusCode") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), parameters: 8683b2ea-1fdc-5039-bfef-16fc96fbb003, 1767840776, max-age=300, must-revalidate, private, blob (400 bytes), W/"004c225e86819612a55f0f28572b103f", blob (2334 bytes), 1, 1767840776, 1767840777, https://e926.net/comments.json?page=1&limit&group_by=comment&search%5Border%5D=id_asc&search%5Bpost_id%5D=6102854, 200
╔ Data ════════════════════════════════════════════════════════════════════════════════════╗
║
║ SqliteException(1032): while executing statement, attempt to write a readonly database, attempt to write a readonly database (code 1032)
║ Causing statement: INSERT OR REPLACE INTO "DioCache" ("cacheKey", "date", "cacheControl", "content", "eTag", "headers", "priority", "requestDate", "responseDate", "url", "statusCode") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), parameters: 8683b2ea-1fdc-5039-bfef-16fc96fbb003, 1767840776, max-age=300, must-revalidate, private, blob (400 bytes), W/"004c225e86819612a55f0f28572b103f", blob (2334 bytes), 1, 1767840776, 1767840777, https://e926.net/comments.json?page=1&limit&group_by=comment&search%5Border%5D=id_asc&search%5Bpost_id%5D=6102854, 200
║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
╔ Stacktrace ══════════════════════════════════════════════════════════════════════════════╗
║
║ package:sqlite3/src/implementation/exception.dart 87 throwException
║ package:sqlite3/src/implementation/statement.dart 109 StatementImplementation._execute
║ package:sqlite3/src/implementation/statement.dart 289 StatementImplementation.executeWith
║ package:sqlite3/src/statement.dart 81 CommonPreparedStatement.execute
║ package:drift/src/sqlite3/database.dart 149 Sqlite3Delegate.runWithArgsSync
║ package:drift/native.dart 384 _NativeDelegate.runInsert.
║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
Where is the database stored? It survived reinstall, so I imagine somewhere in the visible file system. I further suspect not having write permissions there.