caddy-dns / cloudflare

Caddy module: dns.providers.cloudflare
Apache License 2.0
436 stars 59 forks source link

Error on adding temporary record #41

Closed Christoph-AK closed 2 years ago

Christoph-AK commented 2 years ago

Hi! When trying to get a certificate with a not publicly available server I get this error:

"logger":"tls.obtain","msg":"will retry","error":"[ABC.DEF.de] Obtain: [ABC:DEF.de] solving challenges: presenting for challenge: adding temporary record for zone de.: expected 1 zone, got 0 for de.

Caddyfile:

sub1.domain.de {
        reverse_proxy /* frontend:3001
        reverse_proxy /api/* backend:3000
        reverse_proxy /swagger backend:3000
        reverse_proxy /spec backend:3000
}
sub2.domain-dev.de {
        tls {
                dns cloudflare TOKEN
                resolvers 8.8.8.8
        }

        reverse_proxy /* frontend:3001
        reverse_proxy /api/* backend:3000
        reverse_proxy /swagger backend:3000
        reverse_proxy /spec backend:3000
}

The first domain works fine when publicly available for the ACME challenges, but the second won't work.

Dockerfile:

FROM caddy:2-builder-alpine AS builder
RUN xcaddy build --with github.com/caddy-dns/cloudflare

FROM caddy:2-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile .

CMD ["caddy", "run"]

Cloudflare token settings:

image

I tried setting the image version to 2.2.1, as I found other dockerfiles that got it running with that one, but it didn't work for me. Is this extension still supported? What am I doing wrong?

mholt commented 2 years ago

I feel like this is a Cloudflare account misconfiguration (or something like that). Can you please open a help topic in the forum and fill out the help template? Thanks! https://caddy.community