2

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?

Community
  • 1
  • 1
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
  • Did you try to run your padrino app in production mode? That is what phusion passenger will do. Also, does the sqlite file in question exist? What happens if you copy over a development sqlite file? And did you run rake sq:migrate ? – Felix Sep 20 '14 at 12:13
  • I'm not running the app in production mode, as the production db is configured as a pg db [for Heroku] and the pg-db isn't created on my machine, nor is the data there; however I've set passenger to use development mode with the `RACKENV development` flag, and it seems to be trying to use sqlite as if it were in development mode. The sqlite file in question does exist, and is the development sqlite file. I have not run rake sq:migrate, as the db does work as-is under unicorn. – Camden Narzt Sep 20 '14 at 17:16

0 Answers0