SQLite Forum

Timeline
Login

3 forum posts by user markdub

2021-08-13
16:25 Reply: pragma integrity_check; Error: disk I/O error (artifact: 1e2ab03ea5 user: markdub)
oh ... k. Nope, DB wasn't in use by any Moz / other process

last run caught some additional log:

sqlite> pragma integrity_check;
*** in database main ***
Page 6835: unable to get the page. error code=266
Page 6834: unable to get the page. error code=266
Page 6833: unable to get the page. error code=266
Memory Used:                         2282200 (max 2292088) bytes
Number of Outstanding Allocations:   1119 (max 1137)
Number of Pcache Overflow Bytes:     1995760 (max 2004112) bytes
Largest Allocation:                  85120 bytes
Largest Pcache Allocation:           4256 bytes
Lookaside Slots Used:                123 (max 123)
Successful lookaside attempts:       572
Lookaside failures due to size:      5
Lookaside failures due to OOM:       1139
Pager Heap Usage:                    2080408 bytes
Page cache hits:                     198230
Page cache misses:                   30157
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   12024 bytes
Statement Heap/Lookaside Usage:      77840 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               861970
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        77840
Error: disk I/O error

then I tried a batch of integrity_check:

Error: near line 1: disk I/O error
Error: near line 2: disk I/O error
ok
Error: near line 4: disk I/O error
Error: near line 5: disk I/O error
*** in database main ***
Page 7225: unable to get the page. error code=266
Page 7176: unable to get the page. error code=266
Page 7115: unable to get the page. error code=266
Page 4993: unable to get the page. error code=266
Page 4992: unable to get the page. error code=266
Page 4937: unable to get the page. error code=266
Error: near line 6: disk I/O error
Error: near line 7: disk I/O error
Error: near line 8: disk I/O error
Error: near line 9: disk I/O error
Error: near line 10: disk I/O error
ok
Error: near line 12: disk I/O error
Error: near line 13: disk I/O error

while monitoring the cpu/mem usage of MS' antimalware which seemed to spike, so the AV interference might be a thing. 
At this point I fired windows-update & reboot ... now all seem fine:

sqlite> .read ic.sql
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok

each 'ok' is from a integrity_check line in the script.
So whether the culprit was some system bug, AV bug or just memory crap piled up is not clear, but the AV interference sound a sensible option. Wonder if the lib/tool can be made more robust on that.

Anyway, so far my issue seems gone, thanx all!
2021-08-12
22:12 Reply: pragma integrity_check; Error: disk I/O error (artifact: 453605d84e user: markdub)
nope, plain local filesystem.
Funny, quitted then reloaded the DB checked as per original post: last integrity_check got I/O error, now instead (started with -stats):

sqlite> pragma integrity_check;
ok
Memory Used:                         2245720 (max 2278664) bytes
Number of Outstanding Allocations:   690 (max 708)
Number of Pcache Overflow Bytes:     1386928 (max 1419696) bytes
Largest Allocation:                  658560 bytes
Largest Pcache Allocation:           32928 bytes
Lookaside Slots Used:                123 (max 123)
Successful lookaside attempts:       212
Lookaside failures due to size:      1
Lookaside failures due to OOM:       233
Pager Heap Usage:                    2050152 bytes
Page cache hits:                     977275
Page cache misses:                   139191
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   12024 bytes
Statement Heap/Lookaside Usage:      77840 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               6075238
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        77840

got 'ok' yet I/O error was expected, since nothing (in the DB) should have changed between quit/reload.
then re-tried with original copy of the DB, and got error again:

sqlite> pragma integrity_check;
Memory Used:                         2282200 (max 2291816) bytes
Number of Outstanding Allocations:   1119 (max 1129)
Number of Pcache Overflow Bytes:     1995760 (max 2004112) bytes
Largest Allocation:                  85120 bytes
Largest Pcache Allocation:           4256 bytes
Lookaside Slots Used:                123 (max 123)
Successful lookaside attempts:       212
Lookaside failures due to size:      1
Lookaside failures due to OOM:       227
Pager Heap Usage:                    2080408 bytes
Page cache hits:                     460749
Page cache misses:                   63695
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   12024 bytes
Statement Heap/Lookaside Usage:      77840 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               1881471
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        77840
Error: disk I/O error

any cues from above? is there a way to make sqlite3 spit some log?

thx
14:58 Post: pragma integrity_check; Error: disk I/O error (artifact: 4b14f88fc6 user: markdub)
Hi,

while checking a places.sqlite Mozilla's bookmarks DB, I got 

pragma integrity_check;
Error: disk I/O error

that's on Windows 10 though [sqlite3 dll+tools SQLite 3.36.0 2021-06-18], whereas on (Debian, SQLite 3.16.2 2017-01-06) Linux the check yields just 'ok'.

then following hunchs from othe bugs citing I/O error, tried:

sqlite> vacuum;
sqlite> pragma integrity_check;
*** in database main ***
Page 35: unable to get the page. error code=266
Page 34: unable to get the page. error code=266
Page 1275 is never used
Page 1276 is never used
(many times more) ...
Error: disk I/O error

whereas on Linux same sequence yields just 'ok'. Then again

sqlite> vacuum;
Error: disk I/O error

retrying full check

sqlite> pragma integrity_check;
Error: disk I/O error

retrying by single table

sqlite> .tables
moz_anno_attributes    moz_historyvisits      moz_keywords
moz_annos              moz_hosts              moz_meta
moz_bookmarks          moz_inputhistory       moz_origins
moz_bookmarks_deleted  moz_items_annos        moz_places
sqlite> pragma integrity_check(moz_bookmarks);
ok
sqlite> pragma integrity_check(moz_places);
ok
sqlite> pragma integrity_check(moz_annos);
ok
sqlite> pragma integrity_check(moz_anno_attributes);
ok
sqlite> pragma integrity_check(moz_bookmarks_deleted);
ok
sqlite> pragma integrity_check(moz_historyvisits);
ok
sqlite> pragma integrity_check(moz_hosts);
ok
sqlite> pragma integrity_check(moz_items_annos);
ok
sqlite> pragma integrity_check(moz_origins);
ok

but all again fails

sqlite> pragma integrity_check;
Error: disk I/O error

the fs is NTFS, if that matters. Any cues?
thx