Closed matdal5423 closed 3 months ago
From Powerdns documentation: https://doc.powerdns.com/authoritative/http-api/zone.html
404 Not Found – Requested item was not found Returns: Error object
Thanks for reporting this. I was able to verify the bug and also your fix.
A few things:
pre-commit run -a
on your branch (you may need to install pre-commit
)? It should run a few tests and format he code. I was meaning to add a CI action for that a while ago but just did so now.fix: early exit when domain is not equal to the powerdns zone
Let me know if you need any help or further explanation on this, I'm happy to help. If you don't feel like doing that I can also do it on my end, if you prefer.
Hi, I hope now is al correct. I learn something new and 42 is a lucky number!
Thank you!
Hi @kaechele, any update?
Sorry about the delay. Thanks for fixing this! Merging :)
When you try to create a certificate for a specific host that is not the domain it self you get this error: Error determining zone identifier for foo.bar.baz.example.com: '404 Client Error: Not Found for url: http://dns.example.com/api/v1/servers/localhost/zones/foo.bar.baz.example.com.'. (Is your server ID correct?)
This is because the function __resolvedomain defined in class LexiconDNSAuthenticator return the 404 error during the cycle when is checking what are the correct dns zone where to add the TXT challenge record. This seam a normal behaviour of powerdns API.
This fix check if we are at the last iteration of the cycle by evaluate the number of element after split the domain_namy by '.' in this way if we are at the end of the cycle in the list there will be only 1 element, the TLD.