drift icon indicating copy to clipboard operation
drift copied to clipboard

Probably Corrupted DB

Open prismvineeth opened this issue 1 year ago • 4 comments

Probably Corrupted DB

An error ocurred trying to fetch elements from key "0". Error: Invalid argument(s): Invalid typed array length: -1548288
unparsed                                                                at new Uint8Array (<anonymous>)
drift_worker.js 880:36                                              Object.bv
drift_worker.js 12615:19                                            <fn>
drift_worker.js 1724:63                                             qD.a
drift_worker.js 6515:14                                             qD.$2
drift_worker.js 6509:21                                             qk.$1
drift_worker.js 7475:31                                             kq.bf
drift_worker.js 6849:11                                             oZ.$0
drift_worker.js 1836:39                                             Object.e0
drift_worker.js 6783:3                                              q.bq
===== asynchronous gap ===========================
dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 945:28  get current
packages/drift/src/remote/communication.dart 113:66                 request
packages/drift/src/remote/client_impl.dart 157:10                   ensureOpen
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54  runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5  _async
packages/drift/src/remote/client_impl.dart 149:26                   ensureOpen
packages/drift/src/utils/lazy_database.dart 61:49                   <fn>

I am getting this message intermitedly once in a while while working with flutter web - drift: ^2.16.0

Any clue why this is happening ? Sometimes it goes away after clearing all cache and data.

prismvineeth avatar Apr 18 '24 01:04 prismvineeth

Thanks for the report. Are you also using the 2.16 version of drift_worker.js?

simolus3 avatar Apr 18 '24 12:04 simolus3

Yes correct.

prismvineeth avatar Apr 18 '24 13:04 prismvineeth

Sometimes I also get

An error ocurred trying to fetch elements from key “0”. Error: SqliteException(1): while preparing statement, no such table: inquiry_table, SQL logic error (code 1)
  Causing statement: SELECT * FROM “inquiry_table” WHERE “branch_id” = ? AND “inquiry_type” = ? ORDER BY “client_name” ASC LIMIT 10 OFFSET 0;

I do have a migration strategy etc in place

prismvineeth avatar Apr 18 '24 13:04 prismvineeth

I tried clean and regenerate the db files and then tried after clearning cache

prismvineeth avatar Apr 18 '24 13:04 prismvineeth