HTTP error 524

Sort:
JaseZiv

Hi all,

Excuse my ignorance, a relative newbie...

I've written a few functions to extract game archive data and am encountering a 524 error when trying to extract game PGN information...

Anyone able to give some pointers to get around this?

Thanks in advance.

skelos

Have you tried the request in a browser to see if additional information is returned?

It might be from Cloudflare:

524 A Timeout OccurredCloudflare was able to complete a TCP connection to the origin server, but did not receive a timely HTTP response.

 

Or it might be something else. Does this happen for all users, or only some? It's not something I've seen, but I tend to pull game archives and not solely PGN data.

JaseZiv

Yeah tried the request in a browser too and after some time, all that gets returned is a Cloudflare image telling me there was an error with the host.

 

My description of what I'm doing in my function was a little off sorry - I'm pulling in game archives first, then a separate process extracts PGN data from that... I just can't get in all of the archive data. Some data gets returned (error handling is skipping months where the 524 error is occurring), but not all?

andreamorandini

@JaseZiv Can you share a couple of urls that returned a 524 to you, in order to gather more info?

skelos

And are you grabbing the list of available archives first? Not that asking for an unavailable archive should return a 5xx error anyway, but error handling code is always the most vulnerable for bugs. Drive within the lane markers when you can. happy.png

JaseZiv

And just like that, the urls that were giving me grief now miraculously work. @skelos I was definitely only getting the available archives and staying well within the markers!

 

Really appreciate the help here though!

andreamorandini

524 in this context mean that the server is responding too slowly to our CDN. We are investigating if there are some bottlenecks but on your end you can try an incremental retry:

-  Request the url,

- If you get a 524 response wait 2 seconds and try again,

- If you get again a 524 wait 4 seconds and try again,

- Retry for a pre-defined number of times (say 5) and each time increase the waiting.

 

This should give you a correct answer most of the time and at the same time prevent you from getting a "429 - too many requests" error.