Erreur certbot "Text input is malformed"

Bonjour,

Je viens d’installer certbot et configurer mon serveur bind (serveur séparé) pour mettre en place une wildcard pour mon domaine. En lançant la commande certbot ci-après, j’obtiens le message d’erreur ci-après ( certbot.errors.PluginError: Encountered error when making query: Text input is malformed).

Pouvez-vous m’aider ?

Voici les infos demandées :

Je peux lire des réponses en Anglais : YES
Mon serveur Web : Apache/2.4.29 sur Ubuntu 18.04.1 LTS
Mon serveur bind : BIND 9.9.5-3ubuntu0.2-Ubuntu sur Ubuntu 14.04.1 LTS

J’ai exécuté cette commande :

certbot certonly --dns-rfc2136 --dns-rfc2136-credentials .secrets/mydomain.com.tsig -d mydomain.com -d *.mydomain.com

Elle a produit cette sortie :

2020-03-31 14:50:18,254:ERROR:certbot.error_handler:Encountered exception during recovery:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 209, in _query_soa
response = dns.query.udp(request, self.server, port=self.port)
File “/usr/lib/python3/dist-packages/dns/query.py”, line 242, in udp
if _addresses_equal(af, from_address, destination) or
File “/usr/lib/python3/dist-packages/dns/query.py”, line 169, in _addresses_equal
n2 = dns.inet.inet_pton(af, a2[0])
File “/usr/lib/python3/dist-packages/dns/inet.py”, line 51, in inet_pton
return dns.ipv4.inet_aton(text)
File “/usr/lib/python3/dist-packages/dns/ipv4.py”, line 48, in inet_aton
raise dns.exception.SyntaxError
dns.exception.SyntaxError: Text input is malformed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 139, in _solve_challenges
resp = self.auth.perform(all_achalls)
File “/usr/lib/python3/dist-packages/certbot/plugins/dns_common.py”, line 57, in perform
self._perform(domain, validation_domain_name, validation)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 76, in _perform
self._get_rfc2136_client().add_txt_record(validation_name, validation, self.ttl)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 112, in add_txt_record
domain = self._find_domain(record_name)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 186, in _find_domain
if self._query_soa(guess):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 222, in _query_soa
.format(e))
certbot.errors.PluginError: Encountered error when making query: Text input is malformed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 209, in _query_soa
response = dns.query.udp(request, self.server, port=self.port)
File “/usr/lib/python3/dist-packages/dns/query.py”, line 242, in udp
if _addresses_equal(af, from_address, destination) or
File “/usr/lib/python3/dist-packages/dns/query.py”, line 169, in _addresses_equal
n2 = dns.inet.inet_pton(af, a2[0])
File “/usr/lib/python3/dist-packages/dns/inet.py”, line 51, in inet_pton
return dns.ipv4.inet_aton(text)
File “/usr/lib/python3/dist-packages/dns/ipv4.py”, line 48, in inet_aton
raise dns.exception.SyntaxError
dns.exception.SyntaxError: Text input is malformed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/error_handler.py”, line 108, in _call_registered
self.funcs-1
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 323, in _cleanup_challenges
self.auth.cleanup(achalls)
File “/usr/lib/python3/dist-packages/certbot/plugins/dns_common.py”, line 76, in cleanup
self._cleanup(domain, validation_domain_name, validation)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 79, in _cleanup
self._get_rfc2136_client().del_txt_record(validation_name, validation)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 147, in del_txt_record
domain = self._find_domain(record_name)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 186, in _find_domain
if self._query_soa(guess):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 222, in _query_soa
.format(e))
certbot.errors.PluginError: Encountered error when making query: Text input is malformed.
2020-03-31 14:50:18,255:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 209, in _query_soa
response = dns.query.udp(request, self.server, port=self.port)
File “/usr/lib/python3/dist-packages/dns/query.py”, line 242, in udp
if _addresses_equal(af, from_address, destination) or
File “/usr/lib/python3/dist-packages/dns/query.py”, line 169, in _addresses_equal
n2 = dns.inet.inet_pton(af, a2[0])
File “/usr/lib/python3/dist-packages/dns/inet.py”, line 51, in inet_pton
return dns.ipv4.inet_aton(text)
File “/usr/lib/python3/dist-packages/dns/ipv4.py”, line 48, in inet_aton
raise dns.exception.SyntaxError
dns.exception.SyntaxError: Text input is malformed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.31.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1365, in main
return config.func(config, plugins)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1250, in certonly
lineage = _get_and_save_cert(le_client, config, domains, certname, lineage)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 121, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File “/usr/lib/python3/dist-packages/certbot/client.py”, line 410, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File “/usr/lib/python3/dist-packages/certbot/client.py”, line 353, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File “/usr/lib/python3/dist-packages/certbot/client.py”, line 389, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 139, in _solve_challenges
resp = self.auth.perform(all_achalls)
File “/usr/lib/python3/dist-packages/certbot/plugins/dns_common.py”, line 57, in perform
self._perform(domain, validation_domain_name, validation)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 76, in _perform
self._get_rfc2136_client().add_txt_record(validation_name, validation, self.ttl)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 112, in add_txt_record
domain = self._find_domain(record_name)
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 186, in _find_domain
if self._query_soa(guess):
File “/usr/lib/python3/dist-packages/certbot_dns_rfc2136/dns_rfc2136.py”, line 222, in _query_soa
.format(e))
certbot.errors.PluginError: Encountered error when making query: Text input is malformed.

-d '*.mydomain.com'

your shell will expand it otherwise.

I get the same error with
-d mydomain.com -d '*.mydomain.com’
or simply
-d mydomain.com
:confused:

Have you any idea ?

I finally found the problem’s origin.

I replaced
dns_rfc2136_server = ns1.mydomain.com
by
dns_rfc2136_server = xxx.xxx.xxx.xxx

Certbot doesn’t seems to resolve domain names :frowning:

Thank for you help !

4 Likes

Hi @chronotech,

Thank you for looking into this problem more closely and explaining your solution. I agree that Certbot’s error message in this case is quite unhelpful and as a result I’ve filed this issue:

In a future version of Certbot, we will make the error output more specific and helpful in this situation!

3 Likes

Good news :slight_smile:

Have a good day !