ConnectionTimeoutError on Heroku with Postgres

前端 未结 2 1440
攒了一身酷
攒了一身酷 2021-01-03 04:01

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

相关标签:
2条回答
  • 2021-01-03 04:13

    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.

    0 讨论(0)
  • 2021-01-03 04:24

    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.

    0 讨论(0)
提交回复
热议问题