Response code 502\520\400
When using the synchronous (runsync) version of the Runpod API, the system works as expected. However, when switching to the asynchronous version (run), the service consistently returns HTTP error statuses such as 400, 502, and 520. The logs of my backend that runs not on the runpod show the following sequence of events:
I do 10 retries:
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 400
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 400
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 502
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Raranker URL: https://api.runpod.ai/v2/serverless_id/run
Reranking response status: 520
Failed to get reranked results: 520, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url='https://api.runpod.ai/v2/serverless_id/run'
Last error message I received indicated that I expected JSON, but instead I got a Cloudflare HTML page.
Please advise on potential adjustments or any additional configuration that might help the asynchronous mode function correctly without triggering Cloudflare errors. If further details are needed (e.g., additional debug logs or request headers), I am happy to provide them.
I'm using Python, and there are no logs from the RunPod instance—it never gets to the "up" or "queued" state.
1 Reply
can i see your request code / can you check if its all good
but requests are made / created in the endpoint or not?
what is the cloudflare's response?