external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

Don't crash when cloudflare returns 502

Open RichardoC opened this issue 8 months ago • 8 comments

What happened: external-dns crashed when cloudflare returns 502
This happens about once a month in my experience

What you expected to happen: external-dns to log a warning, but continue trying to process other records

How to reproduce it (as minimally and precisely as possible): Have external-dns managing dns records in cloudflare, specifically A records for a zone and running with the following extraargs

extraArgs:

  • "--domain-filter=redacted.example.com"
  • "--domain-filter=another-redacted.example.com"
  • "--cloudflare-proxied" # ensure we get DDoS protection by default
  • "--cloudflare-dns-records-per-page=5000" # to make rate limiting less likely
  • "--zone-id-filter=REDACTED"

Anything else we need to know?:

Here are the relevant logs from the external-dns pod during the issue

time="2025-03-26T12:37:16Z" level=error msg="zone REDACTED lookup failed, received bad gateway response (HTTP 502), please try again later"
time="2025-03-26T12:37:16Z" level=fatal msg="Failed to do run once: received bad gateway response (HTTP 502), please try again later"
[Restarted]
time="2025-03-26T12:38:10Z" level=info msg="Instantiating new Kubernetes client"
....

Environment:

  • External-DNS version (use external-dns --version): Helm package "1.15.0" Image: registry.k8s.io/external-dns/external-dns:v0.15.0
  • DNS provider: Cloudflare
  • Others:

RichardoC avatar Mar 26 '25 14:03 RichardoC