Gwibber won’t start, and how to fix it

I use gwibber to monitor Facebook and Twitter feeds so I don’t have to log in there. It hasn’t worked in a few weeks, and attempting to open the GUI did nothing.

I finally tried running it from the command line and got the obscure error “DatabaseError: database disk image is malformed”, which is tremendously unhelpful and shows someone isn’t checking their error conditions correctly.

Turns out that gwibber stores tons of data in an sqlite database hidden in ~/.config/gwibber. Since sqlite is hardly the most reliable of databases, this can get corrupted.

To fix it, first kill all gwibber-service processes. Then dump the database and rebuild it:

$ cd ~/.config/gwibber
$ echo ".dump" | sqlite3 gwibber.sqlite | sqlite3 new.db
$ mv gwibber.sqlite old.db
$ mv new.db gwibber.sqlite

When you’re happy with the way gwibber, just delete old.db.

I must admit, I’ve never seen the attraction of sqlite. It’s handy if you want to create a small database which you won’t be reading or writing often, but software like this abuses it by creating databases of hundreds of megabytes or more. When gwibber restarted after rebuilding the database it created a journal file of over half a gigabyte on a machine with 3GB free. Not good.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.