Renewal error - UnicodeDecodeError: 'ascii'

Hi,
my automatic renewal with cron job is not working any more. Also manual starting the bot gives me the error. Performing the command:

grep -r -P ‘[^\x00-\x7f]’ /etc/apache2 /etc/letsencrypt /etc/nginx
listed three files:
/etc/letsencrypt/live/mydomain.de/keystore.
/etc/letsencrypt/live/mydomain.de/cert_and_key.p12
/etc/letsencrypt/options-ssl-apache.conf:# TLSv1 -TLSv1.1 hinzugefügt zu SSLProtocol

The first 2 ones were not readable and the content was like this:
����^@^@^@^B^@^@^@^B^@^@^@^A^@^Ftomcat^@^@^Ao����^@^@^E^D0�^E^@0^N^F
+^F^A^D^A*^B^Q^A^A^E^@^D�^D쓎hܓȓQ^[�^VѤ ^O�䤎$ݲ"^U��ﲎ k鲎!jVE�tg貎��ϲ^E?*òv�̦��F�^?�>}�=�ZYΦ+�/�ez߳س)�V.���^��T� ^[R�L��^^^Ff6ɳ/>|���^H���nL�@���ٳ�8��^O$
%QWt^M^S%�)�9^QW����;����8R���k�Z�^Vq��tK^Qbq�^K�^@b���

My domain is:

I ran this command:
sudo /usr/local/bin/certbot-auto --apache
It produced this output:
An unexpected error occurred:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 411: ordinal not in range(128)

And this is the log:

2020-01-23 20:23:06,913:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File “/opt/eff.org/certbot/venv/bin/letsencrypt”, line 11, in
sys.exit(main())
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py”, line 15, in main
return internal_main.main(cli_args)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/_internal/main.py”, line 1351, in main
return config.func(config, plugins)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/_internal/main.py”, line 1212, in certonly
installer, auth = plug_sel.choose_configurator_plugins(config, plugins, “certonly”)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/_internal/plugins/selection.py”, line 224, 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/_internal/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/_internal/plugins/selection.py”, line 104, in pick_plugin
verified.prepare()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py”, line 250, 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/_internal/plugins/disco.py”, line 128, in prepare
self._initialized.prepare()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/_internal/configurator.py”, line 259, in prepare
self.updated_mod_ssl_conf_digest)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/_internal/configurator.py”, line 2335, in install_ssl_options_conf
self.option(“MOD_SSL_CONF_SRC”), constants.ALL_SSL_OPTIONS_HASHES)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/common.py”, line 374, in install_version_controlled_file
active_file_digest = crypto_util.sha256sum(dest_path)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/crypto_util.py”, line 478, in sha256sum
sha256.update(file_d.read().encode(‘UTF-8’))
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 411: ordinal not in range(128)

My web server is (include version):
Server version: Apache/2.4.10 (Debian)
Server built: Sep 30 2019 19:32:08

The operating system my web server runs on is (include version):
Description: Debian GNU/Linux 8.11 (jessie

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):
yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot 1.1.0

Any help or hints are appreciated. Thanks

1 Like

I just found the error. There was a non ASCII charakter in /etc/letsencrypt/options-ssl-apache.conf
as a comment. When it was deleted, certbot worked as expected.
Issue solved.
Thanks!
Thread can be closed.

5 Likes

Thanks for following up to share your solution :tada:

2 Likes

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