[error] * upstream timed out (110: Connection timed out) while reading response header from upstream

Posted July 19, 2013 20.5k views
So I recently deployed a Ruby on Rails app using Nginx, Unicorn, and Capistrano. Everything was working great (and I had used cap :deploy) to deploy changes. Made some recent changes to my site, deployed today and am getting these errors in my nginx/error.log 2013/07/19 19:05:16 [error] 21484#0: *8 upstream timed out (110: Connection timed out) while reading response header from upstream, client:, server: , request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.socialmath.sock:/", host: "" I've tried google, but haven't found anything that worked. Any thoughts on where to look for a fix or an idea for a fix? Thanks much in advance!

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.

Submit an Answer
7 answers
Can you confirm Unicorn is running? Also check your Unicorn log files for issies.
I'm a total newb to this. How do I check if unicorn is running?

The unicorn log files have nothing except from July 17 when I initially generated anything. I assume that means that something is not working with unicorn since it's not logging anything from today.
Nothing from today in your log doesn't have to mean if it's running or not. One way to check for running processes is with ps. If your new unicorn I suggest you read it's documentation a bit to get more familiar with it. (I'm no RoR man so can't really help you with RoR/Unicorn specifics.)
I fixed it with

cap deploy:stop
cap deploy:start

I think it has to do with unicorn looking at an old gem file or old routes (since I had updated my routes to the homepage) and now all is working.

Thanks for your help! I learned what ps does in the command line and will be researching unicorn some more. I haven't found a resource online that explains it in a way I can understand, but I'll get it eventually. Thanks again!
You're welcome, good to hear you solved it!
Thanks. Had the same problem
I am sorry, I think I have the same issue as you.
But I still dont know how to fix it from your solutions.
Can you tell more about it?