Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sqlite3.OperationalError: database or disk is full" on Lustre

Tags:

sqlite

I have this error in my application log:

sqlite3.OperationalError: database or disk is full

As plenty of disk space is available and my SQLite database does not appear to be corrupted (integrity_check did not report any error), why is this happening and how can I debug it?

I am using the Lustre filesystem (with flock set), and until now, it worked perfectly.

Versions are:

  • Python 2.6.6
  • SQLite 3.3.6
like image 486
3r1d Avatar asked Jul 20 '26 15:07

3r1d


1 Answers

It's probably too late for the original poster, but I just had this problem and couldn't find an answer so I'll document my findings in the hope that it will help others:

As it turns out, an SQLite database actually can get full even if there's plenty of disk space, because it has a limit for the number of pages in a database file:

http://www.sqlite.org/pragma.html#pragma_max_page_count

In my case the value was 1073741823, which meant that in combination with a page size of 1024 Bytes the database maxed out at 1 TB and returned the "database or disk is full" error.

The good news is that you can raise the limit; for example double it by issuing PRAGMA max_page_count = 2147483646;.

The limit doesn't seem to be saved in the database file, though, so you have to run it in your application every time you open the database.

like image 121
mthierer Avatar answered Jul 22 '26 07:07

mthierer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!