0

This is a Rails app that runs on Phusion Passenger.

In development environment(passenger standalone mode) I run it in a Vagrant Ubuntu 14.04 based box in a MBP(at work) and a Linux Mint PC(home).

In gemfile: gem 'passenger'

Right now it is at passenger (5.0.25) according to my Gemfile.lock.

The command I normally use to start the rails server is passenger start which is in a Procfile.

rails: passenger start
sidekiq: bundle exec sidekiq

In my home PC, when I issue the command foreman start or passenger start I get:

/home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb:67:in `flock': No locks available @ rb_file_flock - /vagrant/tmp/pids/passenger.3000.pid.lock (Errno::ENOLCK)
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb:67:in `block in exclusive_lock'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb:63:in `open'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb:63:in `exclusive_lock'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb:219:in `start'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb:49:in `start_engine_real'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:322:in `start_engine'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:63:in `run'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/src/ruby_supportlib/phusion_passenger/standalone/main.rb:51:in `run!'
    from /home/vagrant/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.25/bin/passenger:45:in `<top (required)>'
    from /home/vagrant/ruby/bin/passenger:23:in `load'
    from /home/vagrant/ruby/bin/passenger:23:in `<main>'

When I use the command passenger-config restart-app I get:

*** 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.

Env var PASSENGER_INSTANCE_REGISTRY_DIR is not set, so following passenger's documentation I try to set it doing:

export PASSENGER_INSTANCE_REGISTRY_DIR=/vagrant/tmp or export PASSENGER_INSTANCE_REGISTRY_DIR=tmp

And then

sudo -E passenger-status but with this one I get sudo: passenger-status: command not found

As per Hongli's answer in another thread with a similar situation, the command sudo env PASSENGER_INSTANCE_REGISTRY_DIR=/tmp passenger-status returns:

env: passenger-status: No such file or directory

Finally, in my rails app tmp folder there are the passenger pid files:

  • passenger.3000.pid
  • passenger.3000.pid.lock

I'm really clueless. There's no log and everything I've searched and found didn't solve this.

Thanks for helping!

Community
  • 1
  • 1
Francisco Quintero
  • 730
  • 1
  • 13
  • 20
  • Could you please try starting passenger in another port and check if the issue still exist. passenger start -p 3001 – Amal Kumar S Feb 25 '16 at 05:33

1 Answers1

0

Could you please try starting passenger in another port and check if the issue still exist.

passenger start -p 3001

Amal Kumar S
  • 15,555
  • 19
  • 56
  • 88