Hi There. I'm getting the failed to find zone <insert my.domain here> : ListZonesContext command failed: Invalid request headers (6003)
error.
I need it to successfully get the certs so when I load the traefik web interface the https certs show up as valid. Currently, when I go to to the traefik interface, the https certs are shown as invalid. I.e. I appear to be getting the default treafik cert.
I've looked at a few posts here with similar issue, such as this one. However, following those configs just doesn't appear to fix my problem.
Is there something wrong with my config?
Here are each of my config files.
docker-compose.yml
version: '3'
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
environment:
- CF_API_EMAIL=redacted@email.com
#- CF_DNS_API_TOKEN=redactedAPItoken
- CF_API_KEY=YOUR_API_KEY=RedactedAPIkey
# be sure to use the correct one depending on if you are using a token or key
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/mux/dockerfiles/traefik/data/traefik.yml:/traefik.yml:ro
- /home/mux/dockerfiles/traefik/data/acme.json:/acme.json
- /home/mux/dockerfiles/traefik/data/config.yml:/config.yml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.local.redaced.domain`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=redacted@email.com:redacetedSaltedPassword"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard.local.redacted.domain`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=local.redacted.domain"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.local.redacted.domain"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true
traefik.yml
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
https:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /config.yml
certificatesResolvers:
cloudflare:
acme:
email: redacted@email.com
storage: acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
I spin up the container with a :
docker-compose up -d --build --force-recreate
it comes up and I can login to the website, albeit with the invalid https certificates.
the error I see in the logs is :
traefik | time="2023-09-18T21:57:48-07:00" level=error msg="Unable to obtain ACME certificate for do
mains \"local.redacted.domain,*.local.redacted.domain\"" rule="Host(`traefik-dashboard.loca
l.redacted.domain`)" error="unable to generate a certificate for the domains [local.redacted.domain *.local.redacted.domain]: error: one or more domains had a problem:\n[*.local.redacted.domain] [*.local.redacted.domain] acme: error presenting token: cloudflare: failed to find
zone redacted.domain.: ListZonesContext command failed: Invalid request headers (6003)\n[local.redacted.domain] [local.redacted.domain] acme: error presenting token: cloudflare: failed to
find zone redacted.domain.: ListZonesContext command failed: Invalid request headers (6003)\n"
providerName=cloudflare.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" routerName=trae
fik-secure@docker
my acme.json., oddly , appears to be getting something after I spin up the
acme.json
{
"cloudflare": {
"Account": {
"Email": "redacted@email.com",
"Registration": {
"body": {
"status": "valid",
"contact": [
"mailto:redacted@email.com"
]
},
"uri": "https://acme-v02.api.letsencrypt.org/acme/acct/1313638246"
},
"PrivateKey": "MIIJKAIBBq+8wz8ViR7jOgwRrJmFRRDL_REDACTED-KEY_S/cQ=",
"KeyType": "4096"
},
"Certificates": null
}
}
I'm new to Cloudflare, but I think I'm configuring it correctly. see image attached.
my home router is forwarding port 80 and port 443 to my internal server, and the router's firewall has the same allowed.
When I load the traefik web interface I'm not seeing valid https certificates come to my browser. And I'm seeing the above described failed to find zone
error. How do I fix this?