Open dblanque opened 9 months ago
Fixed it manually on my lib/python3.11/site-packages/certbot_dns_powerdns/dns_powerdns.py
by adding the following code to the _handle_http_error
function.
# 4.8.3
str(e).startswith('404 Client Error: NOT FOUND for url:')
def _handle_http_error(self, e, domain_name):
if domain_name in str(e) and (
# 4.0 and 4.1 compatibility
str(e).startswith('422 Client Error: Unprocessable Entity for url:') or
# 4.2
str(e).startswith('404 Client Error: Not Found for url:') or
# 4.8.3
str(e).startswith('404 Client Error: NOT FOUND for url:')
):
return # Expected errors when zone name guess is wrong
return super(_PowerDNSLexiconClient, self)._handle_http_error(e, domain_name)
After upgrading the machine that runs certbot from older versions to latest (Debian/10 with pip versions I guess about 2 or 3 years ago) to currect on Debian/12, I was experiencing comparable issues.
requests.exceptions.HTTPError: 422 Client Error: Unknown Status for url: https://ns1.xxx.nl/api/v1/servers/localhost/zones/hostname.domain.nl.
The version of powerdns wasn't affected (4.0.3) with the mentioned upgrade. Seeing the patch for pdns 4.8.3 I tried to add the error code to certbot_dns_powerdns/dns_powerdns.py and that fixed my issue. So maybe this can be amended for those few that still tun ancient pdns versions and use certbot with the pdns authenticator?
+++ /usr/local/lib/python3.11/dist-packages/certbot_dns_powerdns/dns_powerdns.py 2023-11-22 13:47:26.940731065 +0100
@@ -88,7 +88,9 @@
# 4.0 and 4.1 compatibility
str(e).startswith('422 Client Error: Unprocessable Entity for url:') or
# 4.2
- str(e).startswith('404 Client Error: Not Found for url:')
+ str(e).startswith('404 Client Error: Not Found for url:') or
+ # 4.0
+ str(e).startswith('422 Client Error: Unknown Status for url')
):
return # Expected errors when zone name guess is wrong
return super(_PowerDNSLexiconClient, self)._handle_http_error(e, domain_name)
Hey, I seem to be getting a DNS Lexicon error when renewing a sub-domain for our LDAP Server that didn't happen before. Possibly due to a Python or PDNS Version Change?
PowerDNS Version: 4.8.3 Python Version: 3.11
requirements.txt
If there is any further info I can give let me know.
Error Dump with Debug: