Question

502 Bad Gateway on one-click Ruby Rails app

Hi I’ve been following the deploy your rails app with one click. I’ve tried to deploy my rails app after many several attempts. Any idea what I might be missing or doing wrong? I’ve been following the “How to Use the Ruby on Rails One-Click Application on DigitalOcean” very closely. Thanks!

when I run sudo tail -30 /var/log/nginx/error.log I get

2016/12/24 22:45:39 [error] 19842#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "192.241.137.121"
2016/12/24 22:48:21 [error] 21366#0: *23 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "192.241.137.121"
2016/12/24 22:49:10 [error] 21366#0: *25 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET /todo_lists/index HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/todo_lists/index", host: "192.241.137.121"
2016/12/24 22:50:42 [error] 21366#0: *28 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "192.241.137.121"
2016/12/24 22:55:17 [error] 21366#0: *31 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock/", host: "192.241.137.121"
2016/12/24 22:55:57 [error] 21366#0: *31 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 99.57.138.78, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/unicorn.sock:/", host: "192.241.137.121"

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

First make sure Unicorn is running. Verify it’s service by running:

  1. sudo systemctl status unicorn

You should see there running somewhere.

Beside that you can take a lot at Unicorn logs which should be located in /var/log/unicorn/unicorn.log.

If everything is OK, we will try to find more clues. =)