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-311a222e8fa1] PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly
Nov 06 05:31:21 lmrapp app/web.2: [wbinternacional] [0f0965e3-e537-4aed-8f3e-311a222e8fa1] Completed 500 Internal Server Error in 23ms
Nov 06 05:31:21 lmrapp app/web.2: FATAL: terminating connection due to administrator command
Nov 06 05:31:21 lmrapp app/web.2: ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly
Could it be due to the Connection limit of my Pg plan on heroku (I have "Hobby-basic" which have 20 connections)?
Thanks
I'm getting the exact same error. I also am on a Heroku Hobby-basic db. I raised a ticket with Heroku, here was the response:
To me this basically means Heroku doesn't care to fix this error and wants you to upgrade to the $50 database. Now I'm running a small site where I get 4-5 users/day - there is no way I want to switch to a production site as of yet. I am getting the same error you mentioned at least 5-6 times/day and still haven't figured out a way to fix this. Try switching your db to another shared server - this does not work for me.
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.Hope this helps some people out there!