Worker reports significant volume of 504 errors

I received an email alert reporting that there was a 1000% increase in errors for my website. Upon investigation I discovered that up to 50% of worker requests were 504/520.
The issue is that my host (Site Ground) report no issues and no customer has ever reported an issue with the website being unavailable.
I’ve checked the domain using Cloudflare Diagnostics and everything is fine.
Since only Enterprise customers can access Cloudflare logs what do I do next?

what is your domain name ?

Is this a Worker you created or is this SiteGround’s Worker?

It’s SiteGround’s worker for their Optimiser caching plugin.

Then you’d need to talk to them about it. Unless you want to go through the code and debug it yourself.

I’d talked to SiteGround and their response is ‘There are no issues on our site, you’ll need to talk to Cloudflare’

Error 502 bad gateway or error 504 gateway timeout

An HTTP 502 or 504 error occurs when Cloudflare is unable to establish contact with your origin web server.

There are two possible causes:

502/504 from your origin web server

Cloudflare returns an Cloudflare-branded HTTP 502 or 504 error when your origin web server responds with a standard HTTP 502 bad gateway or 504 gateway timeout error:

Resolution

Contact your hosting provider to troubleshoot these common causes at your origin web server:

  • Ensure the origin server responds to requests for the hostname and domain within the visitor’s URL that generated the 502 or 504 error.
  • Investigate excessive server loads, crashes, or network failures.
  • Identify applications or services that timed out or were blocked.

502/504 from Cloudflare

A 502 or 504 error originating from Cloudflare appears as follows:

If the error does not mention “cloudflare,” contact your hosting provider for assistance on 502/504 errors from your origin.

Resolution

To avoid delays processing your inquiry, provide these required details to Cloudflare Support:

  1. Time and timezone the issue occurred.
  2. URL that resulted in the HTTP 502 or 504 response (for example: https://www.example.com/images/icons/image1.png )
  3. Output from browsing to www.example.com/cdn-cgi/trace (replace www.example.com with the domain and host name that caused the HTTP 502 or 504 error)

The Cloudflare documentation isn’t that helpful. I know was a 502/504 error is. The issue is that errors are being reported by Cloudflare but not SiteGround. Since I’m on the free Cloudflare plan I can’t get any support to determine the source of the errors.

Have you tried the troubleshooting steps?

Resolution/Trobleshooting steps

Contact your hosting provider to troubleshoot these common causes at your origin web server:

  • Ensure the origin server responds to requests for the hostname and domain within the visitor’s URL that generated the 502 or 504 error.
  • Investigate excessive server loads, crashes, or network failures.
  • Identify applications or services that timed out or were blocked.

I take these reports with a grain of salt. It’s probably correct that something is happening, but until someone sees it with the naked eye, I just tuck that info away in the back of my mind.

Hi, do you have SG Optimizer enabled on your Siteground account? If so, that’s actually a Worker running in the background. You’ll need to submit a support request to Siteground because they are in charge of that Worker, which is on the Free plan for your zone. On our end, we’re working to get them to resolve this issue.

Would like to stay in touch about this, please shoot me an email: azhao at cloudflare.com

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