Report this

What is the reason for this report?

ManagedDB not respecting our timeout settings; SSL connection has been closed unexpectedly

Posted on April 6, 2020

We are trying to refresh a materialised view that is going to take roughly 20 to 30 minutes because of huge data set. Since refresh view query does not return anyting so connection is forcefully being killed/closed by managed postgres 11 databaes with the following error message.

FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset: Succeeded.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)

We have tried a lot (eg. I have tried to connect connect via bare postgres-client and ran the commands there by bypassing any GUI tool and app ORM etc.) and nothing sounds working at all. Can you please help us in this regard.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

To help mitigate this issue, you can try increasing the statement_timeout and idle_in_transaction_session_timeout in your PostgreSQL configuration. This can be done through the DigitalOcean Control Panel under the database’s Settings tab by modifying the respective settings values.

If you’re still experiencing issues after adjusting the timeouts, you might consider breaking down the refresh operation into smaller data chunks to better manage the process timeframe.

For additional information, please refer to the DigitalOcean docs on PostgreSQL.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.