Trying To Resolve A PassengerInstanceRegistryDir Error after installing 5.0.22 (Open Source) on my Mac Mini Server running El Capitan

2,140 views
Skip to first unread message

LightBe Corp

unread,
Dec 15, 2015, 3:21:32 PM12/15/15
to Phusion Passenger Discussions
I am running the latest version of the Server app with Web Services turned off. The documentation says that I should have the Passenger configuration statements in /etc/apache2/httpd.conf. This is what I have in that file.

# Phusion Passenger
LoadModule passenger_module /Users/userid/.rvm/gems/ruby-2.2.2@gemset/gems/passenger-5.0.22/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
   PassengerRoot /Users/userid/.rvm/gems/ruby-2.2.2@ gemset/gems/passenger-5.0.22
   PassengerDefaultRuby /Users/userid/.rvm/gems/ruby-2.2.2@ gemset/wrappers/ruby
   PassengerInstanceRegistryDir /tmp
</IfModule>
PassengerDebugLogFile /var/log/apache2/passenger_error_log

I have the following in my ~.bashrc file to set the temp directory. Otherwise I get a crazy looking folder name.
export TMPDIR=/tmp

Here is the value of TMPDIR.

[~]$ echo $TMPDIR

/tmp


Here is is the output when I validate the installation.

[~]$ rvmsudo passenger-config validate-install

sudo: /private/etc/sudoers.d is owned by uid 501, should be 0

Password:

What would you like to validate?

Use <space> to select.

If the menu doesn't display correctly, press '!'


 ‣ ⬢  Passenger itself

   ⬡  Apache


-------------------------------------------------------------------------


 * Checking whether this Passenger install is in PATH...

 * Checking whether there are no other Passenger installations...


Everything looks good. :-)


Here is the output when I try to run passenger-status.

[~]$ rvmsudo passenger-status

sudo: /private/etc/sudoers.d is owned by uid 501, should be 0

ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:


1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.

2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.

[~]$ 


I checked Get Info on /tmp and my id, system, wheel and everyone (not sure why) has read/write access. Passenger never started so I do not have a log file to review.

I initially tried this in the Apache config file used for Web Services and got the same error before realizing I needed to change the config file since I recently quit using Web Services in the Server app. I also encountered the same error with the Enterprise version of 5.0.21 and 5.0.22 before recently uninstalling it.

I started noticing the message about /private/etc/sudoers.d after upgrading the Server app. Currently my id and admin have read/write privileges and wheel & everyone have read privileges.

The few items I have seen online address don't address the error from people using Mac Mini Servers with the Server app. I'm lost as to where to go from here. 

Daniel Knoppel

unread,
Dec 15, 2015, 7:11:08 PM12/15/15
to Phusion Passenger Discussions
The Passenger output says:
"[if] you customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, [..] please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again."

So because you changed it to /tmp in the Apache config, passenger-status can't find it anymore until you set the PASSENGER_INSTANCE_REGISTRY_DIR environment variable to that same folder (or just remove the "PassengerInstanceRegistryDir".. the "crazy looking folder name" is intentional so that it becomes unique and doesn't conflict with anything else).

- Daniel

LightBe Corp

unread,
Dec 15, 2015, 8:03:44 PM12/15/15
to Phusion Passenger Discussions
I initially tried to do a passenger-status without the clause. I got the error below. 

ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:

1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.

2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.


It said that I had moved it and suggested that I set it. I had done nothing other than install Passenger but I added anyhow after reading the documentation. I still get the error whether the clause is there or not.

Hongli Lai

unread,
Dec 16, 2015, 3:46:36 AM12/16/15
to phusion-passenger
So you ran `rvmsudo env PASSENGER_INSTANCE_REGISTRY_DIR=/tmp
passenger-status` and that didn't work?
> --
> 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 https://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/f9894e98-51b2-453b-b230-76ecd5651dd2%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

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

LightBe Corp

unread,
Dec 16, 2015, 8:44:51 AM12/16/15
to Phusion Passenger Discussions, hon...@phusion.nl
I did try that but got the same error.

Note: I never wanted to set the instance registry directory. In fact I was unaware of the advanced setting until I installed 5.0.21 & 5.0.22 and started getting the error. From the documentation this is something new in version 5. This is what is puzzling me. The error suggests I did something that I never did at all. I attempted to set it because it appears that something was missing. People using other server setups with the same problem were able to get their systems working by setting the value somehow. I'm not sure where else to look.

Daniel Knoppel

unread,
Dec 16, 2015, 9:18:20 AM12/16/15
to Phusion Passenger Discussions
You've been through a number of setups (Enterprise, non enterprise, different Server App versions, different configs) such that I'm not really sure what's working and what isn't.

Maybe try to troubleshoot from the start: is passenger actually running?
What does passenger-memory-stats output?

- Daniel

LightBe Corp

unread,
Dec 16, 2015, 9:29:23 AM12/16/15
to Phusion Passenger Discussions
Here is the output.

[~]$ rvmsudo passenger-memory-stats

sudo: /private/etc/sudoers.d is owned by uid 501, should be 0

Password:

Version: 5.0.22

Date   : 2015-12-16 08:19:41 -0600


--------- Apache processes ----------

PID  PPID  VMSize     Resident  Name

-------------------------------------

356  1     2436.6 MB  6.0 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

363  1     2422.5 MB  9.5 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/apache2/services/ACSServer.conf -E /var/log/apache2/services/ACSServer_error_log

366  356   2442.6 MB  4.2 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

367  356   2442.6 MB  3.9 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

368  356   2442.6 MB  4.0 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

369  356   2442.6 MB  4.1 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

370  356   2442.6 MB  3.9 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log

372  363   2420.5 MB  1.2 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/apache2/services/ACSServer.conf -E /var/log/apache2/services/ACSServer_error_log

651  356   2434.6 MB  3.7 MB    /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf -E /private/var/log/apache2/service_proxy_error.log



-------- Nginx processes ---------




--- Passenger processes ----



I still have the TMPDIR set to /tmp in ~/.bashrc and the PassengerInstanceRegistryDir setting in /etc/apache2/httpd.conf.

Note: Before I install a version of Passenger I make sure that I uninstalled all versions of Passenger using the command in the documentation and removing all Passenger statements from the config files. I don't remember seeing in the documentation other steps I may need to take to completely remove Passenger.

Daniel Knoppel

unread,
Dec 16, 2015, 10:21:51 AM12/16/15
to Phusion Passenger Discussions
So there's the problem: Passenger processes is empty, so Passenger isn't actually running, and passenger-status was correctly reporting that.

I would guess your configuration isn't being loaded. 

Under the apache processes I see that most httpd instances are being started with the configuration file (-f) " /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf", and not the file you are editing, " /etc/apache2/httpd.conf". I don't know how the server app is supposed to work but maybe that serviceproxy conf file is supposed to have an include statement for /etc/apache2/*. Or maybe you can configure it somewhere in the server app? 

The Passenger apache2 config validator probably only checks the file in traditional locations (rather than being aware of use through other apps), which is why it doesn't detect this issue.

- Daniel

LightBe Corp

unread,
Dec 16, 2015, 12:38:42 PM12/16/15
to Phusion Passenger Discussions
Daniel,

I spoke with a Apple Server Support Team member a few minutes ago. They confirmed that /Library/Server/Web/Config/apache2/httpd_server_app.conf was the correct Apache config file for Server 4.n.n. For users of Server app 5.n.nn the correct Apache config file is /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf which the passenger-memory-stats command reflected. I added the following statements to the latter config file.

# Virtual hosts

Include /private/etc/apache2/extra/httpd-vhosts.conf

# Phusion Passenger
LoadModule passenger_module /Users/myusername/.rvm/gems/ruby-2.2.2@mygemsetname/gems/passenger-5.0.22/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
   
PassengerRoot /Users/myusername/.rvm/gems/ruby-2.2.2@mygemsetname/gems/passenger-5.0.22
   
PassengerDefaultRuby /Users/myusername/.rvm/gems/ruby-2.2.2@mygemsetname/wrappers/ruby
   
PassengerInstanceRegistryDir /tmp
</IfModule>
PassengerDebugLogFile /
var/log/apache2/passenger_error_log

I was able to successfully display all of my websites.  The only issue remaining with the RoR websites is that the assets are not displaying properly. I executed the three commands below. However none of the images and css are being accessed. I changed from using the touch restart.txt command to passenger-config restart-app. I'm trying to find in the documentation if I need to execute new commands to compile the assets with Passenger 5.

rake assets:clean && rake assets:precompile RAILS_ENV=production && passenger-config restart-app

Note: The documentation on the link below (and maybe other sections) will need to be modified to state that /Library/Server/Web/Config/apache2/httpd_server_app.conf is the correct file for Web Services for Server app version 4 and /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf is the correct file for Websites (note the different name) for Server app version 5.


Thanks so much!

LightBe Corp

unread,
Dec 16, 2015, 12:44:32 PM12/16/15
to Phusion Passenger Discussions
Another thing I forgot to mention is this. When I run passenger-config restart-app it says I have more than one Passenger instance running.

[myrailsapp (master)]$ rake assets:clean && rake assets:precompile RAILS_ENV=production && passenger-config restart-app

I, [2015-12-16T11:42:08.714662 #25000]  INFO -- : Writing /Users/myusername/Sites/myrailsapp/public/assets/application-f0180a2d8db6c18e2b41e12fb6dd1c1e902f2b910eb0516a2bbf4af0b0a94447.js.gz

I, [2015-12-16T11:42:10.015643 #25000]  INFO -- : Writing /Users/myusername/Sites/myrailsapp/public/assets/application-77024ee6321dcfe6519d26add7cc90525fc27bfdb143afe52eaf4a754cff8e2b.css.gz

I, [2015-12-16T11:42:10.019745 #25000]  INFO -- : Writing /Users/myusername/Sites/myrailsapp/public/assets/fontawesome-webfont-61c90f78333473c40f9512789708cdcd8206dd269401103f33d438cd838bb1f0.svg.gz

It appears that multiple Phusion Passenger instances are running. Please select

a specific one by passing:


  --instance <NAME>


The following Phusion Passenger instances are running:


Name                       PID      Description

--------------------------------------------------------------------------

6cbUUm7v                   392      Apache/2.4.16 (Unix) OpenSSL/0.9.8zg Phusion_Passenger/5.0.22

6cbUUm7v                   392      Apache/2.4.16 (Unix) OpenSSL/0.9.8zg Phusion_Passenger/5.0.22


They look exactly the same to me. Maybe this is causing the problem with the assets.

Bernard & Pamela Dreyer

unread,
Dec 16, 2015, 4:14:19 PM12/16/15
to phusion-...@googlegroups.com
I decided to change the DNS of my domains to point to my production server for a while then point them back to my development server. The assets are displaying properly for my Ruby on Rails websites now. At least I now know what to do to update Passenger on my production server when I upgrade my OS and Server app to the current stable versions.

Thanks so much for pointing me in the right direction. I should have thought about checking if Apple changed their Apache configuration. If I run into another problem with Passenger after deploying a major upgrade to the Server app I will  find out if the Apache configuration has changed.

Daniel Knoppel

unread,
Dec 17, 2015, 7:36:52 AM12/17/15
to Phusion Passenger Discussions
Great to hear that you've managed to get things working again!

I just committed a documentation update, thanks for pointing that out!

- Daniel


On Wednesday, December 16, 2015 at 10:14:19 PM UTC+1, LightBe Corp wrote:
I decided to change the DNS of my domains to point to my production server for a while then point them back to my development server. The assets are displaying properly for my Ruby on Rails websites now. At least I now know what to do to update Passenger on my production server when I upgrade my OS and Server app to the current stable versions.

Thanks so much for pointing me in the right direction. I should have thought about checking if Apple changed their Apache configuration. If I run into another problem with Passenger after deploying a major upgrade to the Server app I will  find out if the Apache configuration has changed.

Bernard & Pamela Dreyer

unread,
Dec 17, 2015, 9:14:25 AM12/17/15
to phusion-...@googlegroups.com
Daniel,

I’m glad also. I also upgrade the OS and Server app on my production server and upgraded Passenger Enterprise to 5.0.22 without incident. Both of my servers have the identical setup. I want to have a backup server if for some reason my production server goes down.

On my development server I saw I had a problem with deploying updates. They would not show up. I still had two identical Passenger instances running. I then remembered that I still had the PassengerInstanceRegistryDir setting in my Apache config file. When I removed it I was successful in deploying updates and now only one Passenger instance runs.

Believe me when a major update to the Server app takes place the first thing I will do is run the passenger-memory-stats command to see what the Apache config file if I have problems with Passenger.

Pamela
--
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 https://groups.google.com/group/phusion-passenger.
Reply all
Reply to author
Forward
0 new messages