Hey all,
I am new to traefik and I am having an issue with my configuration. I have spent the past day reading through forum posts where similar issues with acme certificates were brought up but nothing seems to quite match my troubles. My domain is on a .it.com tld, it seems that traefik or lets encrypt is incorrectly thinking that my domain is it.com instead of domain.it.com. I am assuming this is just something I have straight up configured wrong that’s causing it.
The Error:
2025-08-15T14:40:39Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] [portainer.DOMAIN.it.com] acme: Could not find solver for: tls-alpn-01 lib=lego
2025-08-15T14:40:39Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] [portainer.DOMAIN.it.com] acme: Could not find solver for: http-01 lib=lego
2025-08-15T14:40:39Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] [portainer.DOMAIN.it.com] acme: use dns-01 solver lib=lego
2025-08-15T14:40:39Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] [portainer.DOMAIN.it.com] acme: Preparing to solve DNS-01 lib=lego
2025-08-15T14:40:40Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] [portainer.DOMAIN.it.com] acme: Cleaning DNS-01 challenge lib=lego
2025-08-15T14:40:41Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [WARN] [portainer.DOMAIN.it.com] acme: cleaning up failed: cloudflare: failed to find zone it.com.: zone could not be found lib=lego
2025-08-15T14:40:41Z DBG github.com/go-acme/lego/v4@v4.23.1/log/logger.go:48 > [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz/2596210556/569319205776 lib=lego
2025-08-15T14:40:42Z ERR github.com/traefik/traefik/v3/pkg/provider/acme/provider.go:495 > Unable to obtain ACME certificate for domains error="unable to generate a certificate for the domains [portainer.DOMAIN.it.com]: error: one or more domains had a problem:\n[portainer.DOMAIN.it.com] [portainer.DOMAIN.it.com] acme: error presenting token: cloudflare: failed to find zone it.com.: zone could not be found\n" ACME CA=https://acme-v02.api.letsencrypt.org/directory acmeCA=https://acme-v02.api.letsencrypt.org/directory domains=["portainer.DOMAIN.it.com"] providerName=cloudflare.acme routerName=portainer-https@docker rule=Host(`portainer.DOMAIN.it.com`)
My setup is as follows.
Docker running on Truenas Scale v25. Portainer installed via Truenas apps. Traefik installed via Portainer using a docker-compose.yaml stored in github.
Traefiks docker-compose.yaml: traefik docker-compose.yaml - Pastebin.com
Traefik.yaml: traefik.yaml - Pastebin.com
Stack.env just has the following two lines
CF_DNS_API_TOKEN =TOKEN
CF_API_KEY = TOKEN
The labels on Portainer for traefik are
traefik.enable:"true",
traefik.http.routers.portainer-http.entrypoints:"http",
traefik.http.routers.portainer-http.rule:"Host(`portainer.DOMAIN.it.com`)",
traefik.http.routers.portainer-https.entrypoints:"https",
traefik.http.routers.portainer-https.rule:"Host(`portainer.DOMAIN.it.com`)",
traefik.http.routers.portainer-https.service:"portainer-https",
traefik.http.routers.portainer-https.tls:"true",
traefik.http.routers.portainer-https.tls.certresolver:"cloudflare",
traefik.http.services.portainer-https.loadbalancer.server.port:"31015"