e1547 icon indicating copy to clipboard operation
e1547 copied to clipboard

Frequent SQLite errors

Open TheQWERTYCodr opened this issue 1 year ago • 1 comments

Describe the bug Intermittent SQLite errors (attempt to write a readonly database) To Reproduce

  1. ???
  2. Error occurs, app can no longer load any data from e621

Expected behavior The app functions normally

Screenshots Screenshot_20240811-093210.png

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

TheQWERTYCodr avatar Aug 11 '24 13:08 TheQWERTYCodr

Thank you for your issue. We are working on fixing this.

clragon avatar Sep 11 '24 09:09 clragon

Also having an identical issue on android 14 samsung

dmack6464 avatar Feb 01 '25 10:02 dmack6464

exact same issue is still occurring on the latest release no less frequently.

TheQWERTYCodr avatar Apr 28 '25 19:04 TheQWERTYCodr

I'm experiencing the same issue still. Same SqliteException(1032). It makes happens pretty much every screen change.

aslkdfjh7 avatar Jul 26 '25 21:07 aslkdfjh7

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. ║ dart:async/future.dart 315 new Future.sync ║ package:drift/native.dart 383 _NativeDelegate.runInsert ║ package:drift/src/runtime/executor/helpers/engines.dart 106 _BaseExecutor.runInsert. ║ package:drift/src/runtime/executor/helpers/engines.dart 62 _BaseExecutor._synchronized ║ package:drift/src/runtime/executor/helpers/engines.dart 103 _BaseExecutor.runInsert ║ package:drift/src/runtime/api/connection.dart 121 DatabaseConnection.runInsert ║ package:drift/src/remote/server_impl.dart 161 ServerImplementation._runQuery ║ package:drift/src/remote/server_impl.dart 119 ServerImplementation._handleRequest. ║ package:drift/src/remote/communication.dart 165 DriftCommunication.setRequestHandler. ║ ===== asynchronous gap =========================== ║ package:drift/src/remote/communication.dart 113 DriftCommunication.request ║ package:drift/src/remote/client_impl.dart 101 _BaseExecutor._runRequest ║ package:drift/src/remote/client_impl.dart 110 _BaseExecutor._intRequest ║ package:drift/src/remote/client_impl.dart 135 _BaseExecutor.runInsert ║ package:drift/src/utils/lazy_database.dart 91 LazyDatabase.runInsert ║ package:drift/src/runtime/query_builder/statements/insert.dart 74 InsertStatement.insert. ║ package:drift/src/runtime/api/connection_user.dart 171 DatabaseConnectionUser.doWhenOpened. ║ package:drift/src/runtime/query_builder/statements/insert.dart 73 InsertStatement.insert ║ package:http_cache_drift_store/src/store/database.dart 98 DioCacheDao.set ║ package:dio_cache_interceptor/src/dio_cache_interceptor_cache_utils.dart 92 _DioCacheInterceptorUtils._saveResponse ║ package:dio_cache_interceptor/src/dio_cache_interceptor.dart 116 DioCacheInterceptor.onResponse ║
║ ╚══════════════════════════════════════════════════════════════════════════════════════════╝

Erhannis avatar Jan 08 '26 02:01 Erhannis

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.

Erhannis avatar Jan 08 '26 03:01 Erhannis