Passenger Unexpected error in mod_passenger: Unable to connect to Unix socket

I just moved the rails app to a new machine. I am using apache 2.2.3 and passenger 3.0.11. After the initial loading of the databases, I intermittently see an error that says the rails app did not start. This is what I see in my apache error log:

[Sun Mar 18 04:02:13 2012] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[ pid=10788 thr=47366521234240 file=ext/apache2/Hooks.cpp:860 time=2012-03-18 08:51:10.215 ]: Unexpected error in mod_passenger: Cannot connect to Unix socket '/tmp/passenger.1.0.13044/generation-0/socket': No such file or directory (2)
 in 'Passenger::ApplicationPool::Client* Passenger::ApplicationPool::Client::connect(const std::string&, const std::string&, const Passenger::StaticString&)' (Client.h:438)
 in 'Passenger::ApplicationPool::Client* Hooks::getApplicationPool()' (Hooks.cpp:266)
 in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:292)
 in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:561)


I did some searches, but I think I found that the passenger says to upgrade the passenger to version 3, but I'm already on version 3. I also saw someone say to change the logrotat script to restart apache rather than reboot, which did nothing for me. Does anyone have any idea? Here's my apache conf for the passenger. I am using rvm version of ruby ​​enterprise and passenger set as gem:

LoadModule passenger_module /usr/local/rvm/gems/ree-1.8.7-2012.02/gems/passenger-3.0.11/ext/apache2/
PassengerRoot /usr/local/rvm/gems/ree-1.8.7-2012.02/gems/passenger-3.0.11
PassengerRuby /usr/local/rvm/wrappers/ree-1.8.7-2012.02/ruby


I also tried to add rawn spawn method as conservative and add max pool size with the same results. Not sure where to go.


source to share

2 answers

Do you have SELinux enabled? Run cat /selinux/enforce

to find out. If it prints 1

, try disabling SELinux with echo 0 > /selinux/enforce

to see if that solves the problem. If that fixes the problem, you can try to work around it (for example, by setting the PassengerTempDir

. SELinux search option in the Passenger User's Guide ) or leave it disabled forever.



I recently had the same problem. I tried:

sudo /etc/init.d/httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address
no listening sockets available, shutting down
Unable to open logs


As a last resort, you can always "really" restart everything:

sudo killall httpd # <---------
sudo service httpd status
httpd is stopped
sudo service httpd start
Starting httpd:                                            [  OK  ]




All Articles