Saturday, 11 June 2022

Python "[WARNING] Retrying after connection broken by SSLError"

I am running a restful API using Python sqlalchemy. We are running serverless on an AWS lambda proxy, the project I encountered is that sometimes any API endpoints being call would result in a 504 HTTP Status Code. It's not a particular endpoint timing out, it feels pretty random and it happens let's say every 20th API call made (very peculiar). The API gateway has a timeout of 30 seconds.

I am using Python with Sqlalchemy and a Postgresql database. Digging into the logs, I found this error:

[WARNING] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) 
after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol
(_ssl.c:1091)'))': /api/6261774/envelope/

which seems to be consistently happening when the 504 error occurs.

Any support much appreciated.

Initial thoughts:

Give it's occasional, it could be a network connect on failure?

Provisioned concurrency does run the initialisation code which I believe is where the db connection is made. Would it be worth giving it a try with a single instance?



from Python "[WARNING] Retrying after connection broken by SSLError"

No comments:

Post a Comment