SQLite Forum

sqlite3.OperationalError: database or disk is full.
Login

sqlite3.OperationalError: database or disk is full.

(1) By anonymous on 2022-02-16 07:56:49 [link] [source]

Hello,

I am using jupyter notebook to code in python. I am facing an issue while saving any file or even new file. I am getting an error message mention above. Could you please help me resolve this issue ?

(2) By Gunter Hick (gunter_hick) on 2022-02-16 08:34:46 in reply to 1 [link] [source]

This is not an SQLite problem. The error message cleary states that your disk is full. This may be caused by exceeding the physical capacity of the disk, or the assigned quota on some systems. There is nothing SQLite can do about that.

(3) By Ryan Smith (cuz) on 2022-02-16 09:10:17 in reply to 1 [source]

I'm going to be nice and assume you are not oblivious to an overfilled drive, and that the error message is surprising.

Gunter already mentioned that a possible second reason might be a disk-quota that was reached (like on web-servers).

Other places I have seen that error were:

  • When using a small very fast RAM-Drive as my TEMP folder, small enough that the vacuum operation for a large file (or many other DB operations using the TEMP storage) would fail with the same error.
  • Having the DB on a second drive/volume with the TEMP storage on the first smaller OS volume (like a DB on D: and TEMP on C: in Windows).
  • Having insufficient access/space (on the TEMP storage) for the process that opens the DB even though there are plenty space for other processes - I think this is especially prevalent if you force SQLite to use a specific TEMP storage.
  • Using inside a VM with bad space-allocation or a drive that is set to "grow as needed" showing a large size but then restricted externally from growing, though in this case the entire system should be having problems)
  • Using inside Docker, Kubernetes or similar with bad space-allocation settings
  • One I haven't experienced but that might be a problem, is using with TEMP storage set to MEMORY and then running out of memory (I do not really know what happens in that case, just thinking of possible problems)
  • USB sticks with bad allocation tables, the sort that claims to have 128GB of space but then really only has 1GB, sold on a street corner.
  • RAID drive errors or other drive problems perhaps, though this should cause the entire system to be faulty, not just SQLite files.

That's the end of my ideas, maybe someone else have experienced (or know about) others.

What we DO know with the highest degree of certainty: It's not a bug and SQLite is not lying - the OS/storage, wherever/whatever that is, is really full (or reporting to be so).

Good luck and please let us know when you find the problem, what it was, so we can add it to the list for the next person who runs into it.

(4) By anonymous on 2023-07-30 16:46:29 in reply to 1 [link] [source]

I had the same issue in that I was geting this error but actually had plenty of space on my hard drive. I found a helpful answer here: https://stackoverflow.com/questions/16685016/sqlite3-operationalerror-database-or-disk-is-full-on-lustre

I did the following on my linux

Change to the default temporary directory

$ cd /tmp

Find all files in the tmp directory and remove them

$ find -type -f -exec sudo rm '{}' ;

After clearing out the /tmp directory, my code ran as expected. Hope this helps. -ReneKat

(5.1) By Stephan Beal (stephan) on 2023-07-30 16:55:27 edited from 5.0 in reply to 4 [link] [source]

I had the same issue in that I was geting this error but actually had plenty of space on my hard drive.

Based on your posted solution, you didn't have plenty of space on the drive which mattered: the /tmp drive (which is invariably a separate mount point than / or /home on any modern system).

$ find -type -f -exec sudo rm '{}' ;

That is seriously ill-advised. It will delete temp files out from under any and all applications which are using them, regardless of whether they have anything to do with sqlite.

If you need more temp space, tell sqlite it should use a drive with more storage: www:/tempfiles.html#temporary_file_storage_locations