Web Service unable to connect / write to Database - Flask App

Hi All,

I have a flask app that is set up as a Web Service and connected to a PostgreSQL (Both on Render and connected with the Internal Database URL). There is a scheduled task for 12.30 which works fine when I run from a local machine to Database with the External Database URL. But it fails when its run through the web service. Below are the 2 errors. Thanks in advance for any thoughts or suggestions.

Here is the error from the Web Service

Jul 20 12:30:00 PM psycopg2.OperationalError: SSL error: decryption failed or bad record mac

Here is the Error from the Database
Jul 20 12:30:00 PM [64b8c5df.1c896-4] user=rxxxxg3_user,db=rxxxxxg3,app=[unknown],client=10.204.224.249,LOG: SSL error: decryption failed or bad record mac

Hi,

I’ve replied to the ticket you’ve also opened, let’s keep the conversation in one place (on the ticket) and you can update this post when we get to the solution.

Alan

1 Like

Many Thanks Alan,

I got it working after your excellent suggestion.

Since Render does not use SSL for internal connections between webservices and databases, I added “?sslmode=disable” to the end of the Internal Database URL. Though I am not sure if there are any other security issues in doing so, for now the problem is solved.

Best

Cyriac

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