We have a Passenger/nginx application config that was working fine, but has started throwing an error when we configured a new app on it. The setup:
We're running passenger 3.0.12, gem installed, with nginx installed using passenger-install-nginx. We're on ubuntu 10.04, with ruby 1.9.2p290. Here's the error I get in the Rails log:
---cut---
Passenger ApplicationSpawner: /mnt/app/current: No such file or directory - uname -p
[ pid=21422 thr=8199960 file=utils.rb:176 time=2012-11-02 21:05:25.882 ]: *** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (Faraday::Error::ConnectionFailed)) (process 21422, thread #<Thread:0x00000000fa3e30>):
from /usr/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /usr/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /usr/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /usr/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /usr/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /usr/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /usr/lib/ruby/1.9.1/net/http.rb:744:in `start'
from /usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/instrumentation/net.rb:22:in `block in request_with_newrelic_trace'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/instrumentation/net.rb:21:in `request_with_newrelic_trace'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday-0.8.4/lib/faraday/adapter/net_http.rb:74:in `perform_request'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday-0.8.4/lib/faraday/adapter/net_http.rb:37:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/mauth-client-cd7c761346a4/lib/mauth/faraday.rb:17:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/mauth-client-cd7c761346a4/lib/mauth/faraday.rb:10:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday_middleware-0.8.8/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday_middleware-0.8.8/lib/faraday_middleware/request/encode_json.rb:23:in `call'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in `run_request'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:99:in `post'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/eureka-client-842d774bbe35/lib/eureka-client.rb:187:in `block in post_apis!'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/eureka-client-842d774bbe35/lib/eureka-client.rb:187:in `map'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/eureka-client-842d774bbe35/lib/eureka-client.rb:187:in `post_apis!'
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/eureka-client-842d774bbe35/lib/eureka-client.rb:205:in `deploy_apis!'
from config.ru:8:in `block in <main>'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
from /mnt/app/shared/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:225:in `eval'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:225:in `load_rack_app'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:157:in `block in initialize_server'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/utils.rb:563:in `report_app_init_status'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:154:in `initialize_server'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
from <internal:prelude>:10:in `synchronize'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /var/lib/gems/1.9.1/gems/passenger-3.0.18/helper-scripts/passenger-spawn-server:99:in `<main>'
Passenger ApplicationSpawner: /mnt/app/current: No such file or directory - uname -p
---cut---
The directory in question (/mnt/app/current/) exists, and is read/writeable by the Passenger user (not root). That dir is actually not specified anywhere in the nginx config; the root is below that, in /public. I looked in passenger-spawn-server and all I can tell is that line 99 deals with what I think is opening the socket for the spawned worker. I'm not sure why it's calling 'uname -p' there in the error; I don't know enough about what this thing is doing.
Does anyone have any idea where I might start looking? I'm wondering if the directory it's trying to put its socket in is somehow permissioned wrong, but I don't know where it specifies what directory it's using for that. We're using an init.d script to start nginx. Again, this setup is working elsewhere - I'm not sure what's different, but we're using Chef to configure these nodes, so it's entirely possible that some directory or file is either missing or has incorrect permissions - but I'm looking for hints on how to figure out what the problem location is, if that's what's going on. The app is (trying to run) on rails 3.1.8.
Thanks for any help you generous folks can provide. I'm tearing out my graying neckbeard hair.
-jb