Issue with caddy-dynamicdns

1. Caddy version (caddy version):

v2.5.0-rc.1

2. How I run Caddy:

docker run -d --name caddy-front -p 8082:80 -p 443:443 -v /mnt/HD/HD_a2/Laurent/caddy-front/Caddyfile:/etc/caddy/Caddyfile -v /mnt/HD/HD_a2/Laurent/caddy-front/data:/data -v /mnt/HD/HD_a2/Laurent/caddy-front/config:/config -e CLOUDFLARE_EMAIL=myemail -e CLOUDFLARE_API_TOKEN=mytoken -e ACME_AGREE=true --restart always --net dnsnet_iphole --ip 10.0.0.100 gandulf78/caddy-ddns-cloudflare

a. System environment:

Docker on ARMv7

b. Command:

See above

c. Service/unit/compose file:

ARG CADDY_VERSION=2.5.0-rc.1
FROM caddy:${CADDY_VERSION}-builder AS builder

ENV GOOS=linux
ENV GOARCH=arm
ENV GOARM=7
ENV XCADDY_VERSION v0.2.1

RUN xcaddy build ${CADDY_VERSION}
–with GitHub - caddy-dns/cloudflare: Caddy module: dns.providers.cloudflare
–with GitHub - mholt/caddy-dynamicdns: Caddy app that keeps your DNS records (A/AAAA) pointed at itself.

FROM caddy:${CADDY_VERSION}-alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

d. My complete Caddyfile or JSON config:

{
email myemail
acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN}

# Global Option Block
debug	

dynamic_dns {
	provider cloudflare {env.CLOUDFLARE_API_TOKEN}
	domains {
		withlovefromfrance.fr test
	}
}

}

3. The problem I’m having:

The Cloudflare DNS records are not updated.

4. Error messages and/or full log output:

“level”:“debug”,“ts”:1650464856.4456823,“logger”:“dynamic_dns”,“msg”:“beginning IP address check”}
{“level”:“info”,“ts”:1650464856.8964326,“logger”:“pki.ca.local”,“msg”:“root certificate is already trusted by system”,“path”:“storage:pki/authorities/local/root.crt”}
{“level”:“info”,“ts”:1650464856.9010324,“msg”:“autosaved config (load with --resume flag)”,“file”:"/config/caddy/autosave.json"}
{“level”:“info”,“ts”:1650464856.9025605,“msg”:“serving initial configuration”}
{“level”:“info”,“ts”:1650464856.925188,“logger”:“tls”,“msg”:“cleaning storage unit”,“description”:“FileStorage:/data/caddy”}
{“level”:“info”,“ts”:1650464856.947096,“logger”:“tls”,“msg”:“finished cleaning storage units”}
{“level”:“error”,“ts”:1650464857.8098621,“logger”:“dynamic_dns”,“msg”:“unable to lookup current IPs from DNS records”,“error”:“got error status: HTTP 400: [{Code:6003 Message:Invalid request headers}]”}
{“level”:“warn”,“ts”:1650464858.3861866,“logger”:“dynamic_dns.ip_sources.simple_http”,“msg”:“IPv6 lookup failed”,“endpoint”:“https://api64.ipify.org”,“error”:“Get “https://api64.ipify.org”: dial tcp6: lookup api64.ipify.org on 127.0.0.11:53: no such host”}
{“level”:“info”,“ts”:1650464858.3862958,“logger”:“dynamic_dns”,“msg”:“different IP address”,“new_ip”:“79.83.200.71”}
{“level”:“info”,“ts”:1650464858.3863792,“logger”:“dynamic_dns”,“msg”:“updating DNS record”,“zone”:“withlovefromfrance.fr”,“type”:“A”,“name”:“test”,“value”:“79.83.200.71”,“ttl”:1800}
{“level”:“error”,“ts”:1650464859.1720996,“logger”:“dynamic_dns”,“msg”:“failed setting DNS record(s) with new IP address(es)”,“zone”:“withlovefromfrance.fr”,“error”:“got error status: HTTP 400: [{Code:6003 Message:Invalid request headers}]”}
{“level”:“info”,“ts”:1650464859.172176,“logger”:“dynamic_dns”,“msg”:“finished updating DNS”}

5. What I already tried:

Check that TLS ACME certificates are get properly.

6. Links to relevant resources:

Cloudflare has unhelpful error messages, but I think that one means that the API token is wrong, or has the wrong permissions maybe.

I recreated a token from scratch and it is working.
Thank you.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.