How to fix inconsistency error

Yes this is this button.
Given that your backup has 4M blocks, it could take some time. You can follow the advance on the live log (About / Show log)

ok i’ll do it after the shedule backup today to avoid some conflicts.

edit
shedule backup is ended and without any error (i didn’t do the delete and repair yet) but yesterday i got the error so i’ll see tomorrow if i got it again and i’ll let you know

In testing a Block table export as SQL, I put the 307 MB text file into glogg to look at it that way too.

showed up as

 (1051698,'oUrSHbC2MwcAA8ySTkIkJX800dZDU/xDi27Si9aSBw4=',102400,1697),
 (1051649,NULL,NULL,NULL),
 (1051700,'g7BQA6eYvGTu1R4hVb+gjoUjk4Jrnp4fEFmNT41ZIlk=',102400,1692),

and what’s interesting is that it has the spot where 1051699 would be expected (at least by me).

 (1051648,'MfFyr01L0sU8uPKQ/IlwS013bRn9KqcKPgJu10FrySo=',102400,1700),
 (1051649,'ib32tmMA3yPoCm8qUAlNOomUW5wGzyOvClPTprWor7w=',102400,1698),
 (1051650,'lb37bRyU82dGffZHSj03vbctH8bsBhXlULnxhlBCWz4=',102400,1702),

shows ID 1051649 in two rows, in spite of ID being table primary key, which I think is also illegal.
1051699 isn’t mentioned anywhere in the file, however the BlocksetEntry table references it like:

image

so maybe the SQL doing the size calculation takes the BlockID for the missing Block yet adds 0
instead of giving error on should-not-happen situation? My SQL’s not good enough to read it all.

Regardless, I thought it was interesting to look at the shape of the corruption, whatever it means.

How To Corrupt An SQLite Database File is the official document on how corruption may happen.

@ts678

It’s difficult to guess what is the behaviour of a database engine when its files are corrupted. Somehow, the condition

““Block””.““ID”” = ““BlocksetEntry””.““BlockID””

is not satisfied by the database as it is. From the query I displayed (block with an ID between 1051690 and 1051702) did not display the correct block at the expected place. Normal Sql rules can’t apply in this case.

1 Like

seems to be fiexed because i don’t get the error today too.

thank you very much.

1 Like