This morning one of my sites on Dreamhost shared hosting was returning this error page. It is Django / Python / Passenger based.
[code]Internal server error
An internal error occurred while trying to spawn the application.
Exception type: Passenger::SystemException
Error message: Cannot create a pipe: Too many open files (errno=24)
in ‘virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::DirectSpawner::spawn(const Passenger::ApplicationPool2::Options&)’ (DirectSpawner.h:155)
in ‘void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned int)’ (Implementation.cpp:956)
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)
User and groups
Powered by Phusion Passenger, mod_rails / mod_rack for Apache and Nginx.[/code]
Static resources were still working but anything requiring Django would result in a 500 with this message.
I don’t know if this has anything to do with the recent switch from Debian to Ubuntu. I think maybe.
The solution was to go into the panel for the domain (Domains | Manage Domains | mysite.com | Edit) and turn Passenger off, wait a few minutes and turn it back on again. That seemed to reset Passenger somehow. It fixed another of my Passenger sites on the same server as well.
A tip to diagnose this Passenger issue. Add this line to “.bash_profile”:
Passenger runs things through bash if it’s your default shell so, if Passenger is working, a file with that name will be created / modified in the directory for the domain when Passenger does its thing. If it doesn’t appear then something is wrong.