Cannot connect to Unix socket

777 views
Skip to first unread message

John Bradley

unread,
Jul 17, 2013, 9:56:33 AM7/17/13
to phusion-...@googlegroups.com
Hello! Since I have never had the chance to say this before now, thank you a thousand times over for Passenger! Now, on to the problem.

My server is an Ubuntu 12.04 machine running Apache 2.2.22 with Ruby 2.0.0-p247 installed using rvm globally. It hosts a Rails 4 app. Everything is fine using Passenger 4.0.5, but 4.0.8 and 4.0.10 (the versions post-4.0.5 I have tried) throw an internal server error. Here's the pertinent information from Passenger's log:

[ 2013-07-17 09:32:50.8136 18552/7f8cc3c79700 apache2/Hooks.cpp:758 ]: Unexpected error in mod_passenger: Cannot connect to Unix socket '/var/www/tmp/passenger.1.0.18530/generation-0/request': Permission denied (errno=13)
  Backtrace:
     (empty)

PassengerTempDir is set to /var/www/tmp. For what it's worth, here are the details on /var/www/tmp/passenger.1.0.18530:

drwxr-s---  3 root     root     4096 Jul 17 09:32 passenger.1.0.18530

Changing the ownership of passenger.1.0.18530 to the value of PassengerUser fixes the problem temporarily, but any newly-created passenger.x.y.zzzzz directories are owned by root.

Thanks for any help you can provide here, and thanks again for Passenger.

Hongli Lai

unread,
Jul 17, 2013, 1:12:16 PM7/17/13
to phusion-passenger
Hi John. Is Apache's control process (not the normal workers) running as root, or as a normal user?




--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phusion-passen...@googlegroups.com.
To post to this group, send email to phusion-...@googlegroups.com.
Visit this group at http://groups.google.com/group/phusion-passenger.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

John Bradley

unread,
Jul 17, 2013, 1:16:19 PM7/17/13
to phusion-...@googlegroups.com
Hi Hongli,

It is running as root.

-- John

Hongli Lai

unread,
Jul 17, 2013, 1:22:47 PM7/17/13
to phusion-passenger
This is probably a umask issue. Can you check whether it helps if you add this to your Apache init script?

umask u=rwx,g=rx,o=rx

John Bradley

unread,
Jul 17, 2013, 1:28:10 PM7/17/13
to phusion-...@googlegroups.com
Problem solved! Adding it to the init script did not work, but I adjusted the umask directly on that directory. Thanks for your help!

-- John

Hongli Lai

unread,
Jul 17, 2013, 1:29:05 PM7/17/13
to phusion-passenger
What do you mean by adjusting the umask on that directory? umask is a per-process property, not a per-directory property.

John Bradley

unread,
Jul 17, 2013, 1:43:28 PM7/17/13
to phusion-...@googlegroups.com
Hey Hongli,

Sorry, I had gotten confused by something I had done. Yes, adding umask u=rwx,g=rx,o=rx to the init script did the trick. Thanks.

-- John

Hongli Lai

unread,
Jul 17, 2013, 4:54:45 PM7/17/13
to phusion-passenger

John Bradley

unread,
Jul 25, 2013, 9:02:26 AM7/25/13
to phusion-...@googlegroups.com
I've come across what appears to be a related issue. When Apache's logs are rotated (either by cron job or by command) and it is restarted (using the same script in which umask is set) Passenger fails to start. Here is the new error message:

[error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Tried to reuse existing server instance directory /var/www/tmp/passenger.x.y.zzzzz, but it has wrong permissions

/var/www/tmp/passenger.x.y.zzzzz is then removed, apparently upon first access to the website. Apache then throws a 403 for every request. Passenger works again after manually restarting Apache or rotating the logs again. I will continue to look into this, but I thought I should mention it to you.

Thanks again,
John

John Bradley

unread,
Jul 25, 2013, 9:08:37 AM7/25/13
to phusion-...@googlegroups.com
Problem appears to be solved: logrotate was reloading Apache instead of restarting it. After changing this, Passenger appears to restart after log rotation just fine.

Hongli Lai

unread,
Jul 25, 2013, 9:38:42 AM7/25/13
to phusion-passenger
Reloading Apache should be supported just fine. You still get this
problem after setting a correct umask?

On Thu, Jul 25, 2013 at 3:08 PM, John Bradley
Reply all
Reply to author
Forward
Message has been deleted
0 new messages