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

July 19, 2013 10.1k 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: "mrbarrette.com" 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!
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!
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?
Have another answer? Share your knowledge.