SQLite Forum

vtable constructor failed fails in one machine
Login

vtable constructor failed fails in one machine

(1) By David G.F. (davidgf) on 2020-03-29 17:52:44 [link] [source]

Hello there!

I have the weirdest of the errors (vtable constructor failed) in one of my machines but the other one doesn't get that error under the same query and database. To ensure I was not seeing ghosts I copied the database to the two machines, sha1'd them to ensure they are bit identical, used the sqlite3 CLI with the same query and one machine is returning the right output whereas the other one simply returns 'vtable constructor failed'.

I also rebooted the machine and downgraded SQLite. The machine where it fails runs 3.29.9-2 (Fedora 31) and the machine that is happy about it uses 3.22 and runs Ubuntu LTS.

I digged a bit on the error but seems like pretty uncommon but the worst part to me is the fact that I get inconsistencies and can't reproduce it properly.

Thanks!

(2) By David G.F. (davidgf) on 2020-03-29 19:36:29 in reply to 1 [link] [source]

I think it might be a database corruption :O I exported the data using a custom script, tailored after the data I store. And created a new one (which resulted in a file very similar in size and looks). However when using sqlitebrowser the FTS table that throws the error shows up differently there (as it is supposed). And it works!

I still have the corrupted file. I tried using PRAGMA integrity_check but it did not do anything useful to it. Should I try some other check/repair mechanism? I'm curious here.

Also worth mentioning that I got the error when I did a SELECT on the fts vtable, just read only operations.

(3) By Gunter Hick (gunter_hick) on 2020-03-30 06:21:38 in reply to 2 [source]

The "vtable constructor failed" message is caused by the xCreate/xConnect function of the virtual table returning an error.

Since it is an fts5 table, something must have happened to make the fts data invalid.