Errors and troubleshooting
What is Cloudflare error 524?
It means Cloudflare connected to the site's server, sent your request, and then waited longer than its timeout without receiving a response.
The meaning
Error 524, "A timeout occurred", is Cloudflare's way of saying the origin server is alive but too slow. The TCP connection opened and the request was delivered, but no HTTP response arrived within Cloudflare's limit, which at the time of writing is 100 seconds on most plans (Enterprise customers can raise it). Cloudflare closes the wait and shows you its error page. The origin may keep working on your request in the background.
What usually causes it
- Heavy requests. Large searches, reports, exports or uncached pages that run slow database queries.
- An overloaded origin. Under load, even ordinary pages can queue long enough to cross the limit.
- Long running endpoints. Some sites start a long job inside a normal request instead of a background task.
Unlike a challenge page, a 524 is not about bot detection. Your request reached the application; the application did not finish in time.
What a scraper can do
- Make requests lighter. Fewer results per page, narrower filters, shorter date ranges. If 524 appears only on "show all" or large exports, split them.
- Avoid peak hours. If 524s cluster at certain times, schedule your job for quieter ones.
- Retry with patience. Back off by tens of seconds and cap attempts. Retrying a heavy request immediately adds to the load that caused the timeout.
- Lower concurrency on that domain. Ten slow requests in parallel can push the origin over the edge; two may finish fine.
- Be careful with side effects. For POST requests the action may complete after the 524. Check the result before sending it again.
Detecting it in code
A 524 arrives as an HTTP status with a Cloudflare HTML body, after a long wait. Make sure your client timeout is longer than Cloudflare's, or you will see your own timeout error instead of the 524 and misread the cause.
import httpx
slow_ok = httpx.Timeout(connect=10.0, read=130.0, write=10.0, pool=10.0)
with httpx.Client(timeout=slow_ok, follow_redirects=True) as http:
resp = http.get("https://reports.example.com/export?range=2y")
if resp.status_code == 524:
print("origin too slow; narrow the range and retry later")
Splitting a heavy request
If a two year report times out, ask for twenty-four monthly reports instead. If a search returns thousands of rows on one page, use the site's pagination with a small page size. The total work is the same, but each request finishes well inside the limit, and a failure costs you one month instead of the whole export. The entry on pagination covers the patterns, and request timeouts covers client settings.
524 and CAPTCHA tasks
A solving task that loads a page timing out with 524 cannot see the widget or challenge, so it fails and costs nothing. More commonly, the CAPTCHA sits in front of the slow page: you solve it fine, then the request after it hits 524. In that case the token was used but the page was too slow; solve again only after the site responds, since tokens are single use. The page on token reuse explains why the old token will not work for the retry.
How it differs from 522 and 504
Error 522 means the connection to the origin never opened; 524 means it opened and the origin was silent. A plain 504 from a non-Cloudflare gateway is the generic version of the same story. All three call for backoff and lighter requests rather than any change to headers or proxies. The comparison table on error 522 lists the related Cloudflare codes side by side.
Common questions
How long does Cloudflare wait before a 524?
At the time of writing, 100 seconds on most plans; Enterprise customers can configure a longer limit.
Did my request fail if I got a 524?
Not necessarily. The origin may finish the work after Cloudflare stops waiting, so check before repeating actions.
Is a 524 a sign of bot blocking?
No. It means the site was too slow to reply; bot checks look like challenge pages or 1000-range errors.
How do I avoid 524 on large exports?
Split them into smaller requests, such as shorter date ranges or smaller pages, each well under the limit.
Is a solving task charged if the page returns 524?
No. The task fails because the page did not load, and failed tasks are free.
Keep reading
- What is Cloudflare error 522?Error 522 means Cloudflare could not open a connection to the site's origin server in time; it is a server side fault.
- How do I deal with 504 Gateway Timeout?A 504 means a gateway waited too long for the server behind it; retry later, lighten requests and check slow proxies.
- TimeoutConnect, read and total timeouts for HTTP calls, plus the separate deadline for an asynchronous task such as a CAPTCHA solve.
- PaginationHow sites split long lists into pages, cursors and infinite scroll, and how a crawler walks each style to the end.