Since this question seems to be abandoned, I'm going to make an expanded version here.
Similarly to the other question I get a SQLite3::IOException: disk I/O error
when running a rack based application through phusion passenger as soon as the app does a select
.
I have a Padrino application using the Sequel gem against a sqlite3 database. I've been developing on a MacBook Pro running Mavericks. I have been running the app locally using the unicorn gem and everything has been working just fine. Recently I decided to run the application with Passenger and Apache (2.4). When I run the application under passenger/apache, the app errors out with the following printed to the page:
Sequel::DatabaseError at /
SQLite3::IOException: disk I/O error
and then the usual backtrace/environment which doesn't have anything obviously wrong.
The log contains the following additional details:
SQLite3::IOException: disk I/O error: SELECT * FROM `records` ORDER BY `day`
The permissions on the database are set correctly as I can run the app under unicorn fine. I can access and query the db manually (even that exact query), and it passes pragma integrity_check;
.
Phusion Passenger is serving another application (Rails, pg) fine, but may not be configured properly for this one.
You can see the entire code base on my GitHub.
Since I'm using a different local server (unicorn v shotgun), web server (apache v nginx), and application, I think we can narrow this down to only those things in common with the other question:
- OS X Mavericks
- Sequel Gem
- Sqlite3 db & gem
- Phusion Passenger
Also if I start unicorn, and visit the app that way, then quickly visit with apache/passenger then the page loads fine and remains fine for a while but eventually gets the error again after a period of inactivity. Turns out this was because caching was enabled for dev mode for some reason, this has been corrected and now the behavior is consistent (passenger doesn't work, unicorn does.)
I edited the production setup to use the development db, no change.
If I switch to pg everything works fine. I'm just baffled why the sqlite gem won't work.
Anyone have any ideas?