PQconsumeInput() server closed the connection unexpectedly

I’ve migrated an existing Rails/PostgreSQL app, but it keeps losing connection to PostgreSQL with the error:

ActiveRecord::ConnectionFailed: PQconsumeInput() server closed the connection unexpectedly
This probably means the server terminated abnormally before or while processing the request.

There is nothing in the PostgreSQL logs, and I’ve confirmed that it has enough memory and drive storage. If the connection was being dropped by PostgreSQL, I would have thought it would leave something in the log.

I’ve also read over my Rails logs, but they only have that error

1 Like

FYI: I’ve just had the same issue a few minutes ago.
This was the first time I’ve seen it.

I’ve closed the console and opened again and it is all good for me.
The app logs shows the app machine shutdown and restarting, maybe that is what caused the connection error.

Yesterday I’ve bumped the machines for the app and db to performance-1 but I don’t think this can be the root cause.

Based on my logs, it doesn’t appear that the application server is rebooting. Once the error occurs, the instance will continue throwing the same error. On the other hand, other instances may continue working. They all have the issue, but it’s intermittent

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.