Tag Archives: software

No SQLite over NFS

I was recently going to view the contents of a backed up database and ran into the following error:
%sqlite3 backup_db_130614.db
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
Error: disk I/O error
sqlite>

So I pulled another backup, tried again and got the same error and this all repeated a couple of times. After verifying on the live database that all was fine I started looking around for an answer to what was going on with my backups.

As it turns out, you cannot run SQLite over nfs due to locking issues. Simple as that, but perhaps a little less than optimal error message.

From the FAQ over at www.sqlite.org:

This is because fcntl() file locking is broken on many NFS implementations. You should avoid putting SQLite database files on NFS if multiple processes might try to access the file at the same time.

Share