Phusion passenger-status: what value for passenger

2019-02-06 06:03发布

I've done a new install of nginx 1.6.3 and passenger 5.0.15 on Ubuntu 14.04 from source in order to add tracing components from AppNeta for my ROR 4.2 app on one of my servers. Nginx and passenger are running and serving pages. I am getting the trace data for server monitoring. All seems well,

However, when I run "passenger-status" (as root), I get the following:

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.

The problem with this is that it seems to be blocking capistrano deploys; this same error is displayed by cap before exiting.

Passenger is running (it's in the ps output and pages are being served). I just need to tell passenger-status where to find the current running instance. (This is from the Design and Architecture documentation.) Therefore, it seems that setting this instance registry directory value is the required step. But to what value?

According to the Nginx Reference, the defaults are /tmp and /var/run/passenger-instreg And I've found an instance directory in /tmp. So, I've tried setting the PASSENGER_INSTANCE_REGISTRY_DIR to a number of different values:

  • /tmp
  • /tmp/passenger.JxmCeiA (the current instance directory, but this changes with each startup of Nginx)

I've even tried creating a directory at /run/passenger, setting that value in the nginx configuration file and restarting nginx. The temporary directory is being created, but passenger-status still gives the same message. Even if I use the /opt/passenger-5.0.15/bin/passenger-status script to make sure I'm using the latest version of that script.

There are some configuration values in the original 'location.ini' directory for passenger, but none were the instance registry directory, so there was nothing to reuse.

Interestingly, the /opt/passenger-5.0.15/lib/phusion_passenger/nginx/config_options.rb file does not have an entry for passenger_instance_registory_dir. It has other nginx configuration options, I would have expected it to have this one as well.

I've tried setting the environment variable as well as the Nginx passenger_instance_registry_dir option, but I must be missing something in my understanding because I can't seem to connect the passenger-status command with the current running instance.

Any help would be greatly appreciated.

3条回答
做个烂人
2楼-- · 2019-02-06 06:56

Passenger author here.

/tmp/passenger.JxmCeiA is an example of an instance directory. This changes indeed with every startup (because it is specific to an instance).

The parent directory (the directory in which instance directories are located) is the instance registry directory. So in your case, the instance registry directory that is being used is /tmp.

I'm guessing that you have some kind of Passenger installation version mismatch. We've changed the structure of the instance directory a few times in the past, and every time we did this we bump an internal version number to indicate that it's incompatible with previous Passenger versions. Can you double check the following?

  • Does Passenger appear to be otherwise running correctly?
  • What Passenger version is compiled inside Nginx?
  • What is your passenger_root set to? Does it match the Passenger version compiled inside Nginx?
  • Where is the full path to the first passenger-status in PATH? Does it match passenger_root?

You also seem to be mixing the Phusion Passenger APT repository with source tarball install. Having multiple installations around is generally a bad idea. Try cleaning up your other installs so that you only end up with one.

Also check whether you are setting the PASSENGER_INSTANCE_REGISTRY_DIR environment variable correctly. Note that sudo nukes environment variables, so you need to run passenger-status like this:

# Correct:
sudo env PASSENGER_INSTANCE_REGISTRY_DIR=/tmp passenger-status

# Incorrect, sudo nukes environment variables
export PASSENGER_INSTANCE_REGISTRY_DIR=/tmp
sudo passenger-status

Regarding lib/phusion_passenger/nginx/config_options.rb: that file mainly lists per-server and per-location config options. Many config options in the main context are either not yet ported to the config_options.rb system, or not possible because they require custom attention. At present, passenger_instance_registry_dir is implemented in ext/common/nginx/Configuration.c. As we continue to cleanup and refactor the codebase, this option may eventually be moved to config_options.rb.

查看更多
姐就是有狂的资本
3楼-- · 2019-02-06 06:57

step one check phusion passenger is installed correctly

sudo passenger-config validate-install

"if you see an ouput saying, 'Everything is looks good :-)'" then you are fine, if not you need to reinstall phusion passenger, refer to https://www.phusionpassenger.com/library/walkthroughs/start/

step two check the phusion passenger memory status

sudo passenger-memory-stats

"if you see processes running, then that's good, if not you either have to start some passenger app, or install nginx or apache with extra library for them. For nginx you need nginx and the nginx-extras".

step three uncomment the passenger_root in the nginx.conf file (for ubuntu it's usually /etc/nginx/nginx.conf) or the apache.conf file

restart nginx or apache

sudo service nginx restart # (or systemctl restart nginx, for new version of linux such as ubuntu 15.04, CentOS7)

now you can run

passenger-status 

the error should go away now. The mostly likely output you will get is saying "Phusion Passenger is currently not serving any applications."

查看更多
我命由我不由天
4楼-- · 2019-02-06 07:00

In case anyone else is having this problem when starting Passenger using a systemd service, this might be due to systemd's private /tmp. The problem was solved by adding PrivateTmp=false to the service file.

Source

查看更多
登录 后发表回答