Certbot-auto fails to renew with unicode error

Hello,

While trying to update my certificate for my domain pcdt.be, I encountered this error:

Attempting to renew cert (pcdt.be) from /etc/letsencrypt/renewal/pcdt.be.conf produced an unexpected error: ‘utf8’ codec can’t decode byte 0xe8 in position 2: invalid continuation byte. Skipping.

certbot-auto is 0.34.2, running on Apache 2.4.10 on debian 8.

Here is the result from the log:
2019-05-22 21:45:27,976:DEBUG:certbot.main:certbot version: 0.34.2
2019-05-22 21:45:27,976:DEBUG:certbot.main:Arguments: [’–dry-run’]
2019-05-22 21:45:27,976:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2019-05-22 21:45:27,987:DEBUG:certbot.log:Root logging level set at 20
2019-05-22 21:45:27,988:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2019-05-22 21:45:28,018:DEBUG:certbot.plugins.selection:Requested authenticator <certbot.cli._Default object at 0x7f4c123b7810> and installer <certbot.cli._Default object at 0x7f4c123b7810>
2019-05-22 21:45:28,018:DEBUG:certbot.cli:Var dry_run=True (set by user).
2019-05-22 21:45:28,018:DEBUG:certbot.cli:Var server=set([‘staging’, ‘dry_run’]) (set by user).
2019-05-22 21:45:28,018:DEBUG:certbot.cli:Var dry_run=True (set by user).
2019-05-22 21:45:28,018:DEBUG:certbot.cli:Var server=set([‘staging’, ‘dry_run’]) (set by user).
2019-05-22 21:45:28,018:DEBUG:certbot.cli:Var account=set([‘server’]) (set by user).
2019-05-22 21:45:28,045:DEBUG:certbot.storage:Should renew, less than 30 days before certificate expiry 2019-06-11 19:02:30 UTC.
2019-05-22 21:45:28,045:INFO:certbot.renewal:Cert is due for renewal, auto-renewing…
2019-05-22 21:45:28,046:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2019-05-22 21:45:28,227:DEBUG:certbot_apache.configurator:Apache version is 2.4.10
2019-05-22 21:45:28,763:WARNING:certbot.renewal:Attempting to renew cert (pcdt.be) from /etc/letsencrypt/renewal/pcdt.be.conf produced an unexpected error: ‘utf8’ codec can’t decode byte 0xe8 in position 2: invalid continuation byte. Skipping.
2019-05-22 21:45:28,765:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/renewal.py”, line 449, in handle_renewal_request
main.renew_cert(lineage_config, plugins, renewal_candidate)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py”, line 1199, in renew_cert
installer, auth = plug_sel.choose_configurator_plugins(config, plugins, “certonly”)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py”, line 226, in choose_configurator_plugins
installer = pick_installer(config, req_inst, plugins, installer_question)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py”, line 31, in pick_installer
config, default, plugins, question, (interfaces.IInstaller,))
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py”, line 105, in pick_plugin
verified.prepare()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/disco.py”, line 253, in prepare
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/disco.py”, line 131, in prepare
self._initialized.prepare()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 269, in prepare
self.vhosts = self.get_virtual_hosts()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 855, in get_virtual_hosts
new_vhost = self._create_vhost(path)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 831, in _create_vhost
self._add_servernames(vhost)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 781, in _add_servernames
servername, serveraliases = self._get_vhost_names(host.path)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 763, in _get_vhost_names
serveralias = self.parser.get_arg(alias)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/parser.py”, line 509, in get_arg
value = self.aug.get(match)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/augeas.py”, line 147, in get
return dec(value.value)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/augeas.py”, line 65, in dec
return st.decode(AUGENC)
File “/opt/eff.org/certbot/venv/lib/python2.7/encodings/utf_8.py”, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe8 in position 2: invalid continuation byte

Apparently it has to do with some problem with an invalid character somewhere, but I do not know how to find the offending character location.

Can anyone help out? Is there a bug in certbot-auto 0.34.2?

Hi @angerized

that's a known bug of Certbot.

0xe8 = è. You have that character somewhere in one of your config files (certbot or your webserver).

1 Like

Thank you for your reply. Probably some frenchness somewhere in the comments…

I found it :slight_smile: Thanks

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.