-
Notifications
You must be signed in to change notification settings - Fork 248
Random SSL connection errors when downloading from replicate.delivery on Cloud Run #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @AusafG5 👋 Thanks for the detailed report! This seems to be related to intermittent SSL handshake issues between Cloud Run and the replicate.delivery CDN. These types of errors are often caused by the environment’s outbound networking layer rather than the CDN itself. Here are a few things to try:
Let me know if this helps stabilize your downloads on Cloud Run! |
Hey @Ivan-developer0, thanks for the reply. I've spent around 2 full days, trying to get this to work with no avail :( Just putting for more context Things I've tried includes combination of the following failed workarounds:
None of them have worked so far, to be fair tho, i don't even remember half of the stuff i did, so these might as well work for others. Also i mailed replicate guys, got a reply, might help others ![]() Luckily for me I was able to replicate (xD) the entire flow with a local model instead. I would ask replicate guys tho: Anyways thanx for the reply again 😄 . |
You Well come :) |
I’m using the Replicate Python client to create predictions with webhook callbacks. The webhook sends URLs pointing to images on replicate.delivery CDN. My backend downloads these images asynchronously using aiohttp in a Cloud Run environment.
The problem is, about half the time the downloads fail with this error:
Cannot connect to host replicate.delivery:443 ssl:default [None]
This never happens when I run the same code locally or through ngrok tunnels. I tried messing with SSL settings in aiohttp but no luck.
Here’s the snippet I use to download images:
Some extra info:
I can’t get file objects directly from
predictions.get()
, only URLs afaik.I need async downloads because I get multiple webhook calls at once.
Cloud Run’s networking and DNS seem fine otherwise.
Looks like this might be some temporary SSL or network issue with replicate.delivery CDN?
Can you please let me know:
Are there any known connectivity issues with replicate.delivery from cloud platforms like Cloud Run?
Do you recommend any specific SSL or network settings to fix this?
Is there any way to get file-like objects directly from the Replicate API instead of URLs, so I can avoid downloading manually?``
The text was updated successfully, but these errors were encountered: