Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passenger doesn't seem to be running (Capistrano/Rails/Nginx/Ubuntu)

I'm deploying my app in Ubuntu 14.4, Ruby 2.3.3, Nginx and Passenger. When I deploy using capistrano, I get the error:

SSHKit::Command::Failed: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** 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 one of:

 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 this command 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.

Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as user@IP-Address: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** 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 one of:

 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 this command 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 have tried several suggestions such as: https://www.pistolfly.com/weblog/en/2016/01/passenger-config-and-passenger-status-result-in-an-error-on-centos7.html

Passenger doesn't seem to be running (Capistrano/Rails/Apache/Ubuntu)

But nothing helped! I have checked my Nginx default_sites to see if I point to current rails path and everything looks correct.

Any help is appreciated!

like image 255
Rubioli Avatar asked Dec 24 '22 05:12

Rubioli


1 Answers

This issue was fixed by adding restart.txt in my_app_name/current/tmp:

*It's done in the server:

*touch my_app_name/current/tmp/restart.txt

And add:

set :passenger_restart_with_touch, true in deploy.rb

UPDATE

In the newest version of capistrano, this is taken care of by gem 'capistrano-passenger' and adding adding require 'capistrano/passenger' in your capfile

like image 53
Rubioli Avatar answered Jan 31 '23 04:01

Rubioli