Heroku + Rails + PG: ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly

前端 未结 2 1125
攒了一身酷
攒了一身酷 2021-02-20 03:52

I am receiving randomly and very frequently the following error in my logs:

Nov 06 05:31:21 lmrapp app/web.2:  [wbinternacional] [0f0965e3-e537-4aed-8f3e-311a222         


        
2条回答
  •  [愿得一人]
    2021-02-20 04:39

    I get this problem all of the time and it is very annoying. Specially when you are trying to build an app and don't want to pay $50 / month while still in development. One of the biggest things that I have noticed helps is to make sure you don't have something like DB Visualizer or another DBMS running while you are developing. I know it seems counter intuitive but it definitely helps to keep the db pool freed up.

    Also, if you are running RoR you can try adding pool: 1 to your default connection string to ensure your app is not trying to connect to postgres more than your postgres settings will allow on Heroku.

    default: &default
      adapter: postgresql
      encoding: unicode
      pool: 1
    

    Hope this helps some people out there!

提交回复
热议问题