I can't seem to figure out what is causing the I/O Error:

$sqlite3 db.sqlite < data.sql 
(3850) disk I/O error
Error: near line 2: disk I/O error
(3850) disk I/O error
Error: near line 3: disk I/O error
(3850) disk I/O error
Error: near line 5: disk I/O error
(3850) disk I/O error
Error: near line 8: disk I/O error
(3850) disk I/O error
Error: near line 9: disk I/O error

See the contents of data.sql below

$ less data.sql
.log stderr 
PRAGMA synchronous = OFF;
PRAGMA journal_mode = MEMORY;
CREATE TABLE "temp_user_C560B60C-B690-FF4A-8D35-C9A6D4EE2A6B_purchases" (
  "product_id" varchar(36) NOT NULL
INSERT INTO "temp_user_C560B60C-B690-FF4A-8D35-C9A6D4EE2A6B_purchases" VALUES ('C6E07AA2-5B01-11E4-9116-00166E0083A1');
INSERT INTO "temp_user_C560B60C-B690-FF4A-8D35-C9A6D4EE2A6B_purchases" VALUES ('C6E07AA2-5B01-11E4-9116-00166E0083AA');

I already saw this issue: disk I/O error in SQLite but my issue generates a different error code after I inserted .log stderr at the top of the data.sql file and I am not using Virtualbox - I am not sure if the host is using another form of virtualisation.

  • Is db.sqlite in the current working directory? Does sqlite3 db.sqlite by itself on the command-line give any errors? – Philᵀᴹ Feb 23 '15 at 18:30
  • Looks like a probably write permission issue on the file db.sqlite anyway. Do you have write permission on it? Also, check the user hasn't exceeded its Unix quota. (The 3850 error code is present in the sqlite test suite, and tests for file access) – Philᵀᴹ Feb 23 '15 at 18:36

So our sysadmin just told me: "we use VMWare virtualization, and the system is fully optimized as a VM (virtio, etc.).You are trying to do the read and the write to an NFS mounted disk (my home directory)" I tried the command in /tmp and it worked there.

  • I had the same problem. Copying the file to any other mounted filesystem worked, but any copy on the original filesystem failed. So I presume that sqlite did some strange filesystem-level locking. Rebooting solved the issue. – Fritz Oct 24 '18 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.