zachomedia / cert-manager-webhook-pdns

A PowerDNS webhook for cert-manager
MIT License
57 stars 33 forks source link

Error when presenting challenge with version 2.0.0 #11

Closed fabiorauber closed 2 years ago

fabiorauber commented 2 years ago

I'm experiencing errors when presenting challenges to PowerDNS using the webhook container image zachomedia/cert-manager-webhook-pdns:v2.0.0.

30/03/2022 08:52:12 I0330 11:52:12.922203       1 dns.go:88] cert-manager/challenges/Present "msg"="presenting DNS01 challenge for domain" "dnsName"="my.domain.com.br" "domain"="my.domain.com.br" "resource_kind"="Challenge" "resource_name"="mydomain-crt-pz788-3163645891-1197698134" "resource_namespace"="mydomain" "resource_version"="v1" "type"="DNS-01"
30/03/2022 08:52:13 E0330 11:52:13.007850       1 controller.go:163] cert-manager/challenges "msg"="re-queuing item due to error processing" "error"="Key 'disabled' not present or not a Bool" "key"="mydomain/mydomain-crt-pz788-3163645891-1197698134"

I've downgraded cert-manager-webhook-powerdns to version v1.0.0 and the challenge was validated successfully.

zachomedia commented 2 years ago

@fabiorauber Thanks for the report. I haven't seen that error yet myself, but I'll take a look. Can you share what version of PowerDNS you're running?

fabiorauber commented 2 years ago

Sure @zachomedia, I've tested with version 4.1.5.

zachomedia commented 2 years ago

@fabiorauber I can't download PowerDNS 4.1.5 for testing as they have been removed as it's end of life. However, based on the error message, I have updated the code to explicitly set disabled to false on the record.

Can you try this test image I built? zachomedia/cert-manager-webhook-pdns:test-disabled-key-fix

If it works, I'll merge the branch and tag a 2.0.1.

zachomedia commented 2 years ago

I believe this will fix it, digging through PowerDNS Auth repo I found https://github.com/PowerDNS/pdns/pull/8325, where the disabled field was made optional in 4.3.

fabiorauber commented 2 years ago

Hi @zachomedia, I've tested with "test-disabled-key-fix" version tag and, indeed, the certificate was issued successfully. Thank you!

zachomedia commented 2 years ago

Awesome, thanks for the confirmation @fabiorauber! I'll merge it in and tag a release then.

zachomedia commented 2 years ago

v2.0.1 has been released. Thanks for reporting the issue @fabiorauber!