web-dev-qa-db-ja.com

乗客+ Nginx => 502悪いゲートウェイ

比較的単純なRails app(http://www.enkiblog.com/))を実行しようとしていますが、それはちょっと機能します。コメントと管理インターフェースは、「スクリプト」を使用した場合にのみ機能します。/server -e production」を実行し、ポート3000に接続します(ただし、本番モードのままです)。

Nginxは彼のerror.logにこれを持っています:

2009/06/02 21:46:10 [error] 11536#0: *18 upstream prematurely closed
connection while reading response header from upstream, client:
85.180.23.43, server: *.marc-seeger.de, request: "GET /admin HTTP/
1.1", upstream: "unix:/tmp/passenger.11520/master/
helper_server.sock:", Host: "www.marc-seeger.de"
*** Exception NoMethodError in application (undefined method `each'
for nil:NilClass) (process 14080):
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/rack/request_handler.rb:
85:in `process_request'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_request_handler.rb:
203:in `main_loop'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/railz/
application_spawner.rb:340:in `start_request_handler'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/railz/
application_spawner.rb:298:in `handle_spawn_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/utils.rb:181:in `safe_fork'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/railz/
application_spawner.rb:296:in `handle_spawn_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in
`__send__'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in
`main_loop'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:187:in
`start_synchronously'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:154:in
`start'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/railz/
application_spawner.rb:192:in `start'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:257:in
`spawn_Rails_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/
abstract_server_collection.rb:126:in `lookup_or_add'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:251:in
`spawn_Rails_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/
abstract_server_collection.rb:80:in `synchronize'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/
abstract_server_collection.rb:79:in `synchronize'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:250:in
`spawn_Rails_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:153:in
`spawn_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:282:in
`handle_spawn_application'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in
`__send__'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in
`main_loop'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:187:in
`start_synchronously'
        from /opt/Ruby-enterprise-1.8.6-20090421/lib/Ruby/gems/1.8/
gems/passenger-2.2.2/bin/passenger-spawn-server:61
Error during failsafe response: closed stream

何か案が?

p.s. debian 5.0

1
rb2k

それは乗客+ sqlite + nginx + unixパーミッションの問題であることが判明しました。
MySQLに移行して「解決」しました

0
rb2k

SQLiteデータベースに適切な権限が設定されていない場合、nginxからこのような502エラーが発生する可能性があります。

1
Kenzie