当我打开我的rails应用程序时,我收到504网关超时错误。
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
答案 0 :(得分:2)
您的后端独角兽工作进程崩溃,但您只包括堆栈跟踪的底部。 unicorn.log
文件中的完整堆栈跟踪将显示应用程序代码中崩溃的内容。我猜错了中间件或反应不正确。