fazalmajid / temboz

The Temboz RSS/Atom feed reader
MIT License
82 stars 4 forks source link

fts_au trigger causing "<class 'sqlite3.DatabaseError'>: database disk image is malformed" #125

Open Silthanis opened 2 years ago

Silthanis commented 2 years ago

Again, on Debian 11 "Bullseye" with Python 3.9

No feed items are added on feed update. Server output is attached below.

Deleting the ft_au trigger in rss.db allows the feed to update, but will presumably break full text search.

server.log

fazalmajid commented 2 years ago

Unfortunately the error says "database disk image is malformed", which does not give much hints as to what is wrong. Is your build of SQLite enabled with fts5? How did you install it? You can find out by running:

echo "pragma compile_options;" | sqlite3 | grep FTS

You've been experiencing a great many problems with this, and I apologize for that. Would you be willing to try a Docker version instead? I never finished it, but hopefully it would yield more deterministic results.

Silthanis commented 2 years ago

The message is really generic, which is why it took me a while to trace it as far as the ft_au trigger. Unfortunately, I'm not familiar enough with sqlite3 to take it much past that.

It's Debian's stable packaged version of sqlite3, and does appear to be fts5 enabled:

$ echo "pragma compile_options;" | sqlite3 | grep FTS ENABLE_FTS3 ENABLE_FTS3_PARENTHESIS ENABLE_FTS3_TOKENIZER ENABLE_FTS4 ENABLE_FTS5

I generally prefer to avoid Docker if I can. Since I'm just running this for myself at this point it's one thing for me to trust the Debian maintainers with security, but quite another to trust the entire chain of docker images chosen by the developer of each program I run. I understand that Docker is easier on the developer to support and that temboz was written first and foremost to make your life easier rather than harder, though, so if you don't want to go down this road I get it.

This looks to be the last issue though, after which I'm planning to start working on - and hopefully contributing back - a bayesian scoring plugin. scikit-learn looks promising for that. My hope is to use the score for sorting and/or filtering.

fazalmajid commented 1 year ago

FYI I just fixed some bugs with the search functionality. I doubt they have any relation with this issue but worth trying out.