I’m having problems with my application deployed on Heroku. It works fine on local env, but when deployed to Heroku there are often application errors.
The exception
The code example you posted is legitimate. There is likely something causing a problem in your Heroku config environment.
The error you are seeing would indicate your DB_POOL
value is set too low. This error indicates a timeout within the app server waiting to check a connection out of the pool, not necessarily a connection failure. Is it possible your DB_POOL
is set to 1 or a low value?
You should also verify that your database configuration is complete, that you have the full hostname, credentials, and config set from the default db configuration. You can run the following in a Heroku console:
Rails.application.config.database_configuration[Rails.env]
There is something incorrect in your Heroku config settings that is causing this timeout.
Your DB pool is not the problem. This is a known rails issue. If you are using Rails 4.0.2 then the claim is to use rails master in your Gemfile instead. I am experiencing this issue as well, however I haven't tried this solution yet.