Nav links

Thursday, 17 July 2008

Zero byte SQLite journal

My MovableType blog stopped working a few days ago. When I tried to login it acted as though it was a new installation, and started the setup process. I traced this problem to the blog's SQLite database being locked. This was stated quite clearly when using the CLI to connect to the database, and running the .databases command.

SItting next to the database was a 0 byte blog.db-journal file. Reading the SQLite docs I determined that this was not a "hot" journal, and was thus safe to remove (well, rename to start with). This succeeded in removing the lock, and my blog started working again. Incidentally, my initial attempt to fix this was by uploading a backup of my database. However, this didn't help because the journal (of which I knew nothing at the time) was not removed.

I don't know what caused this hiccup, but knowing that my database was managed by the eminently straightforward SQLite and that I had recent backups made this a relatively stress-free learning experience.