4
votes

I'm new here so be gentle.

I recently set up a new VPS to run a ruby-on-rails site. I've installed the following apps with the versions as mentioned. I get a Bad Gateway error. I looked around the web and stackoverflow but haven't been able to isolate any discussion on this error.

Can someone throw some light on this please. Thank you for your inputs. Alf

  • Server: Ubuntu 14.04
  • Ruby: 2.2
  • Rails: 4.2
  • nginx: 1.6.0
  • Passenger: 4.0.46

Error logs - with passenger_log_level set to 7. Main bits below, I can also upload a txt file if I can figure out how.

The main error code I can spot is this one. It goes in an infinite loop once a request is made:

2015-01-14 16:38:49.7008 2348/7fa01e892700 agents/HelperAgent/RequestHandler.h:2626 ]: [Client 20] End of (unbuffered) client body reached; done sending data to application
App 2367 stderr: [ 2015-01-14 16:38:49.7012 2442/0x007f052879f318(Main thread) request_handler.rb:181 ]: Entering request handler main loop
App 2367 stderr: /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:356:in `trap'
App 2367 stderr: : 
App 2367 stderr: Invalid argument - SIGKILL
App 2367 stderr:  (
App 2367 stderr: Errno::EINVAL
App 2367 stderr: )
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:356:in `block in reset_signal_handlers'
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:354:in `each_key'
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:354:in `reset_signal_handlers'
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:182:in `main_loop'
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/helper-scripts/rack-preloader.rb:161:in `'
App 2367 stderr:    from /usr/local/lib/ruby/gems/2.2.0/gems/passenger-4.0.46/helper-scripts/rack-preloader.rb:29:in `'

I've also noticed the below, just once, when nginx/passenger is started:

[ 2015-01-14 16:38:46.8338 2348/7fa0209bf700 Pool2/SmartSpawner.h:353 ]: [App 2367 stdin >>] 
App 2367 stderr: /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.1.1/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
[ 2015-01-14 16:38:48.0003 2348/7fa020aa3700 Pool2/Pool.h:836 ]: Analytics collection time...
[ 2015-01-14 16:38:48.0021 2348/7fa020aa3700 Pool2/Pool.h:942 ]: Analytics collection done; next analytics collection in 4.998 sec
App 2367 stderr: /usr/bin/env: 
App 2367 stderr: ruby
App 2367 stderr: : No such file or directory
App 2367 stderr: 
[ 2015-01-14 16:38:49.6243 2348/7fa0209bf700 Pool2/Spawner.h:790 ]: [App 2367 stdout] !> Ready
[ 2015-01-14 16:38:49.6245 2348/7fa0209bf700 Pool2/Spawner.h:790 ]: [App 2367 stdout] !> socket: unix:/tmp/passenger.1.0.2344/generation-0/backends/preloader.2367
[ 2015-01-14 16:38:49.6247 2348/7fa0209bf700 Pool2/Spawner.h:790 ]: [App 2367 stdout] !> 

nginx is started via an /etc/init.d/nginx script which mainly does this:

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
1
Isn't this the right forum to ask such a question?Alf Steed

1 Answers

6
votes

I never got the exact above setup to work. In the end, I upgraded Passenger to 4.0.57 and that worked!