Phusion Passenger status crashing with too long socket name

Viewed 532

I am trying passenger on Ubuntu 18.04, pretty much generic install and the passenger-status call crashes. Not super clear how to set the path that it uses for local socket communication.

Version : 6.0.12
Date    : 2021-11-17 23:20:19 +0000
Instance: PdoRpeL5 (Apache/2.4.29 (Ubuntu) Phusion_Passenger/6.0.12)

Traceback (most recent call last):
    6: from /usr/sbin/passenger-status:349:in `<main>'
    5: from /usr/sbin/passenger-status:346:in `start'
    4: from /usr/sbin/passenger-status:62:in `command_show_status'
    3: from /usr/sbin/passenger-status:124:in `show_status'
    2: from /usr/lib/ruby/vendor_ruby/phusion_passenger/admin_tools/instance.rb:94:in `http_request'
    1: from /usr/lib/ruby/vendor_ruby/phusion_passenger/admin_tools/instance.rb:94:in `new'
/usr/lib/ruby/vendor_ruby/phusion_passenger/admin_tools/instance.rb:94:in `initialize': too long unix socket path (116bytes given but 108bytes max) (ArgumentError)

Looking at that code, @path is /tmp/systemd-private-af50a27a57d04fec9366f72dd251a3be-apache2.service-Dy9bBV/tmp/passenger.PPuC2RN which makes the socket name /tmp/systemd-private-af50a27a57d04fec9366f72dd251a3be-apache2.service-Dy9bBV/tmp/passenger.PPuC2RN/agents.s/core_api

Seems like a passenger internal issue but I'm looking for a workaround...

1 Answers

Have you tried editing your web server service file, nginx.service or apache2.service? I had this problem and solved it by removing the line:

PrivateTmp=true

from /etc/systemd/system/multi-user.target.wants/apache2.service.

Then:

sudo systemctl daemon-reload
sudo systemctl restart apache2

https://github.com/phusion/passenger/issues/2397

"this is because the path generated by the systemd private tmp feature is 80 chars long, which only leaves 27 chars for an application to use, and passenger uses 35 chars in its path to its socket."

Related