mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
250 stars 25 forks source link

panic: assignment to entry in nil map #43

Closed namazso closed 1 year ago

namazso commented 1 year ago
May 10 22:21:01 server2 caddy[1379103]: {"level":"info","ts":1683750061.5673218,"logger":"dynamic_dns","msg":"domain not found in DNS","domain":"dyn"}
May 10 22:21:01 server2 caddy[1379103]: {"level":"info","ts":1683750061.567349,"logger":"dynamic_dns","msg":"domain not found in DNS","domain":"dyn"}
May 10 22:21:02 server2 caddy[1379103]: {"level":"info","ts":1683750062.661033,"logger":"dynamic_dns","msg":"updating DNS record","zone":"~~~","type":"A","name":"~~~","value":"~~~","ttl":0}
May 10 22:21:02 server2 caddy[1379103]: {"level":"info","ts":1683750062.6610668,"logger":"dynamic_dns","msg":"updating DNS record","zone":"~~~","type":"AAAA","name":"~~~","value":"~~~","ttl":0}
May 10 22:21:06 server2 caddy[1379103]: panic: assignment to entry in nil map
May 10 22:21:06 server2 caddy[1379103]:
May 10 22:21:06 server2 caddy[1379103]: goroutine 49 [running]:
May 10 22:21:06 server2 caddy[1379103]: github.com/mholt/caddy-dynamicdns.App.checkIPAndUpdateDNS({{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0xc00021d5c0, 0x0, 0x0, {0x0, ...}, ...})
May 10 22:21:06 server2 caddy[1379103]:         github.com/mholt/caddy-dynamicdns@v0.0.0-20230504171859-9f5dde239475/dynamicdns.go:254 +0xab1
May 10 22:21:06 server2 caddy[1379103]: github.com/mholt/caddy-dynamicdns.App.checkerLoop({{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0xc00021d5c0, 0x0, 0x0, {0x0, ...}, ...})
May 10 22:21:06 server2 caddy[1379103]:         github.com/mholt/caddy-dynamicdns@v0.0.0-20230504171859-9f5dde239475/dynamicdns.go:150 +0xb8
May 10 22:21:06 server2 caddy[1379103]: created by github.com/mholt/caddy-dynamicdns.App.Start
May 10 22:21:06 server2 caddy[1379103]:         github.com/mholt/caddy-dynamicdns@v0.0.0-20230504171859-9f5dde239475/dynamicdns.go:135 +0xaa
mholt commented 1 year ago

Oops, probably a bug in 9f5dde2 -- /cc @francislavoie if you have a minute. I might be able to get around to it later though.

namazso commented 1 year ago

Judging from when my logs became very big, it's probably that commit, yes

image

francislavoie commented 1 year ago

Dangit :man_facepalming: I probably forgot to make the map, it's an annoyingly easy thing to forget to do in Go and the compiler doesn't check for that.

mholt commented 1 year ago

Yeah, no worries -- done that tons of times myself.