Heroku Error H12 (Request timeout) issue

I had a very similar problem and narrowed it to a connection issue with the database. I'm using ClearDB on Heroku's Cedar stack and found that by inserting "use ActiveRecord::ConnectionAdapters::ConnectionManagement" in my config.ru file, the problem goes away.


Seems that you are getting a timeout, maybe that feed() call takes more than 30 seconds?

More about H12 error codes at https://devcenter.heroku.com/articles/error-codes#h12__request_timeout. I also recommend you to install rack-timeout as described at https://devcenter.heroku.com/articles/request-timeout.


I had a similar issue and after giving up for a day, I came back to it and found my error. I wasn't sending a response to the client when an error occurred on the server side. Make sure you are returning a response no matter what the result of your server side algorithm is. If there is an error, return that. If the request was successful, return that response. I hope that helps.

If that doesn't help, check out heroku's guides on handling Request Timeouts, especially the Debugging request timeouts section could be of help.


The errors turned out to be application.css. There are bugs in one .css.scss files in /assets/stylesheets

When I ran rake assets:precompile on local mahcine, it showed errors in application.css. It indicated which code in application.css is wrong.

After I revised css and I have to put config.assets.initialize_on_precompile = false' inconfig/application.rb' http://www.simonecarletti.com/blog/2012/02/heroku-and-rails-3-2-assetprecompile-error/

The problem solved!