UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb


#1

Hello,

I’m getting the following when trying to renew a certificate.

root@user:~# certbot certonly --force-renew -d domain.com -d www.domain.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
An unexpected error occurred:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xcb in position 32: invalid continuation byte
Please see the logfiles in /var/log/letsencrypt for more details.

The content of letsencrypt.log is:

2018-05-04 04:33:39,733:DEBUG:certbot.main:certbot version: 0.22.2
2018-05-04 04:33:39,734:DEBUG:certbot.main:Arguments: [’–force-renew’, ‘-d’, ‘domain.com’, ‘-d’, ‘www.domain.com’]
2018-05-04 04:33:39,735:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-05-04 04:33:39,745:DEBUG:certbot.log:Root logging level set at 20
2018-05-04 04:33:39,746:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-05-04 04:33:39,747:DEBUG:certbot.plugins.selection:Requested authenticator None and installer None
2018-05-04 04:33:40,488:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.22.2’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1266, in main
return config.func(config, plugins)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1136, in certonly
installer, auth = plug_sel.choose_configurator_plugins(config, plugins, “certonly”)
File “/usr/lib/python3/dist-packages/certbot/plugins/selection.py”, line 194, in choose_configurator_plugins
authenticator = pick_authenticator(config, req_auth, plugins)
File “/usr/lib/python3/dist-packages/certbot/plugins/selection.py”, line 40, in pick_authenticator
config, default, plugins, question, (interfaces.IAuthenticator,))
File “/usr/lib/python3/dist-packages/certbot/plugins/selection.py”, line 77, in pick_plugin
verified.prepare()
File “/usr/lib/python3/dist-packages/certbot/plugins/disco.py”, line 245, in prepare
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File “/usr/lib/python3/dist-packages/certbot/plugins/disco.py”, line 245, in
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File “/usr/lib/python3/dist-packages/certbot/plugins/disco.py”, line 126, in prepare
self._initialized.prepare()
File “/usr/lib/python3/dist-packages/certbot_nginx/configurator.py”, line 137, in prepare
self.parser = parser.NginxParser(self.conf(‘server-root’))
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 38, in init
self.load()
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 45, in load
self._parse_recursively(self.config_root)
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 66, in _parse_recursively
self._parse_recursively(subentry[1])
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 66, in _parse_recursively
self._parse_recursively(subentry[1])
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 56, in _parse_recursively
trees = self._parse_files(filepath)
File “/usr/lib/python3/dist-packages/certbot_nginx/parser.py”, line 206, in _parse_files
parsed = nginxparser.load(_file)
File “/usr/lib/python3/dist-packages/certbot_nginx/nginxparser.py”, line 123, in load
return loads(_file.read())
File “/usr/lib/python3.5/codecs.py”, line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xcb in position 32: invalid continuation byte
2018-05-04 04:33:40,490:ERROR:certbot.log:An unexpected error occurred:


#2

Could you paste the exact command and result, without redacting the name? It seems something you passed it was not a valid UTF-8 character. Sometimes this is from attempting to use an international domain name without converting to Punycode, of sometimes it’s a terminal input setup issue.


#3

Sure.

certbot certonly --force-renew -d ecoview.gr -d www.ecoview.gr


#4

In this case I think this is a matter of Greek text in your nginx configuration file. There are known bugs with Certbot where we can crash when an Apache or nginx configuration contains non-ASCII text (potentially even in a comment!). This is not correct behavior on Certbot’s part.


#5

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