Python API App becomes stale hours after deployment.

I have a simple API (Fast API) python app through a Dockerfile on DO App Platform. When I deploy it fresh it works really well. After about 24 hours of being idle, the server will respond with a 500 for about 5-10% of requests (to the same endpoint)…

I’ve narrowed it down to a DB Connection error: Interface already closed. But it only happens when deployed, and being idle for about 24 hours. Been trying to reproduce locally (no luck), and directly after a fresh deploy. After a fresh deploy, I can hit the URL 1000 times with no issues.

Any Digital Ocean App Platform specific things I should look at to continue troubleshooting ?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Hey there!

I wonder if this may be related to the database connections staying open. It could be possible you are running out of connections and it eventually fails. I’d recommend opening a ticket with our support team the next time you are seeing those 500 errors and they can take a look.

Hope it helps! Nate