DigitalOcean Rails Droplet Nginx Timeout

December 7, 2014 1.4k views

Hey Guys,

Went through the steps in this as well as this tutorial but keep getting a 504 Nginx error.

Here is the output from tail /var/log/nginx/error.log

2014/12/07 16:55:03 [error] 682#0: *50 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.235.112.224, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "104.131.76.121"
2014/12/07 16:56:57 [error] 682#0: *50 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.235.112.224, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "104.131.76.121"
2014/12/07 16:59:51 [error] 682#0: *53 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.235.112.224, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "104.131.76.121"

And here is the error log from tail /home/unicorn/log/unicorn.log

/usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:294:in `join'
/usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in `load'
/usr/local/rvm/gems/ruby-2.1.3/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-12-07T17:01:16.737896 #29412] ERROR -- : reaped #<Process::Status: pid 30156 exit 1> worker=0
I, [2014-12-07T17:01:16.738189 #29412]  INFO -- : worker=0 spawning...
I, [2014-12-07T17:01:16.746972 #30169]  INFO -- : worker=0 spawned pid=30169
I, [2014-12-07T17:01:16.778199 #30169]  INFO -- : Refreshing Gem list

Looking for some direction on how to solve this. Is my unicorn gem incorrect?

2 comments
  • Now I am getting this in my tail -n 100 /home/unicorn/log/unicorn.log

    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:7:in `<module:Hooves>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:5:in `<top (required)>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves.rb:1:in `<top (required)>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
    /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/default.rb:1:in `<top (required)>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
    /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
    /home/rails/config/application.rb:7:in `<top (required)>'
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    /home/rails/config/environment.rb:2:in `<top (required)>'
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    config.ru:2:in `block in <main>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    config.ru:1:in `new'
    config.ru:1:in `<main>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `eval'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `block in builder'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `call'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `build_app!'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:628:in `init_worker_process'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:651:in `worker_loop'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:536:in `maintain_worker_count'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:294:in `join'
    /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
    /usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in `load'
    /usr/local/rvm/gems/ruby-2.1.3/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-12-07T18:18:48.772501 #19977] ERROR -- : couldn't find HOME environment -- expanding `~' (ArgumentError)
    
  • I have now progressed to a new error:

    couldn't find HOME environment -- expanding `~' (ArgumentError)
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:37:in `expand_path'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:37:in `singleton class'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:8:in `<module:Unicorn>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:7:in `<module:Hooves>'
    /usr/local/rvm/gems/ruby-2.1.3/gems/hooves-0.7/lib/hooves/unicorn.rb:5:in `<top (required)>'
    
1 Answer
Have another answer? Share your knowledge.