Render keeps on automatically calling my flask app

So I have a flask app in python, it is pretty complicated-ish but this issue happens with the basic quickstart app too so thats not the problem.

So this app uses multiple apis in it and they do have a somewhat limited quota. So for some reason render is randomly opening my flask app right after deployment, what looks like multiple times and it is breaking my app completely and ultimately it shuts down.

So in the logs, after:

==> Running 'gunicorn app:app'

It right after calls in less than a second and does its just a mess of random stuff my app prints out when ran and ultimatley the quota runs out for one api and:

[2024-07-17 14:58:53,820] ERROR in app: Exception on / [HEAD]
...
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B-Instruct/v1/chat/completions

After this error, my flask app would usually just stop, but a the app is like opened right after that again, and this is printed, and the same error above occures:

127.0.0.1 - - [17/Jul/2024:14:59:44 +0000] "HEAD / HTTP/1.1" 500 0 "-" "Go-http-client/1.1"

And then after some time it will randomly stop and nothing will print in the logs but also the flask app doesn’t work anymore.

I couldn’t find anything about anywhere, does anyone have any clue what is happening?

The flask app runs fine on my computer.

Hi there,

This is our port detection process, trying to determine whether the ports your services have open are TCP ports or HTTP ports. For 15 minutes after a deployment, you will see HEAD requests being made to your service.

What are you using to perform rate limiting on your service?

Regards,

Keith
Render Support, UTC+10 :australia:

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