1

当我打开我的 Rails 应用程序时,我收到 504-Gateway 超时错误。

结果tail /var/log/nginx/error.log

upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
2014/01/27 12:38:05 [error] 621#0: *63 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
2014/01/27 13:05:53 [error] 621#0: *73 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
2014/01/27 13:16:28 [error] 621#0: *77 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173"
2014/01/27 13:18:49 [error] 621#0: *80 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 122.169.153.194, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "162.243.204.173" 

然后,内容tail /home/unicorn/log/unicorn.log

* Restarting Unicorn web server unicorn                                                                                                [ OK ] 
root@liquorexam:/home/rails# tail /home/unicorn/log/unicorn.log
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/unicorn-4.7.0/lib/unicorn    /http_server.rb:303:in `join'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/unicorn-4.7.0/bin/unicorn:126:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `load'
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `<main>'
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
E, [2014-01-27T13:16:14.982896 #20809] ERROR -- : reaped #<Process::Status: pid   
21135 exit 1> worker=0
I, [2014-01-27T13:16:14.983194 #20809]  INFO -- : worker=0 spawning...
I, [2014-01-27T13:16:14.988711 #21141]  INFO -- : worker=0 spawned pid=21141
I, [2014-01-27T13:16:15.019707 #21141]  INFO -- : Refreshing Gem list
4

1 回答 1

2

您的后端独角兽工作进程正在崩溃,但您只包括堆栈跟踪的底部。文件中的完整堆栈跟踪unicorn.log将向您显示应用程序代码中的崩溃情况。我猜是中间件不好或响应格式错误。

于 2014-01-27T16:00:14.580 回答