UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 35: invalid continuation byte

Please fill out the fields below so we can help you better.

My domain is: multiples

I ran this command: certbot-auto

It produced this output:
Creating virtual environment…
Installing Python packages…
Had a problem while installing Python packages.

pip prints the following errors:

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Exception:
Traceback (most recent call last):
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/commands/install.py”, line 272, in run
with self._build_session(options) as session:
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/basecommand.py”, line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/download.py”, line 329, in init
self.headers[“User-Agent”] = user_agent()
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/download.py”, line 93, in user_agent
from pip._vendor import distro
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py”, line 1050, in
_distro = LinuxDistribution()
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py”, line 594, in init
if include_lsb else {}
File “/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py”, line 922, in _get_lsb_release_info
stdout, stderr = stdout.decode(‘utf-8’), stderr.decode(‘utf-8’)
File “/root/.local/share/letsencrypt/lib64/python2.6/encodings/utf_8.py”, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xf3 in position 35: invalid continuation byte

Certbot has problem setting up the virtual environment.

My web server is (include version):
Server version: Apache/2.2.15 (Unix)
Server built: Jul 12 2017 13:32:34

The operating system my web server runs on is (include version):
CentOS 6.9 64 bit
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

It may be the version of certbot
certbot-auto --version

Could you show us the output of lsb_release -a? That’s what this code is trying to run and parse at this point.

certbot-auto --version
Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap)
yum is /usr/bin/yum
Complementos cargados:fastestmirror, security
Configurando el proceso de instalación
Loading mirror speeds from cached hostfile

  • base: repo1.dal.innoscale.net
  • epel: fedora-epel.mirror.lstn.net
  • extras: repo1.dal.innoscale.net
  • remi: repo1.dal.innoscale.net
  • remi-php55: repo1.dal.innoscale.net
  • remi-safe: repo1.dal.innoscale.net
  • updates: repo1.dal.innoscale.net
    El paquete gcc-4.4.7-18.el6.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete augeas-libs-1.0.0-10.el6.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete openssl-1.0.1e-57.el6.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete openssl-devel-1.0.1e-57.el6.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete libffi-devel-3.0.5-3.2.el6.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete redhat-rpm-config-9.0.3-51.el6.centos.noarch ya se encuentra instalado con su versión más reciente
    El paquete ca-certificates-2017.2.14-65.0.1.el6_9.noarch ya se encuentra instalado con su versión más reciente
    El paquete python-2.6.6-66.el6_8.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete python-devel-2.6.6-66.el6_8.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete python-virtualenv-1.10.1-1.el6.noarch ya se encuentra instalado con su versión más reciente
    El paquete python-tools-2.6.6-66.el6_8.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete python-pip-7.1.0-1.el6.noarch ya se encuentra instalado con su versión más reciente
    El paquete 1:mod_ssl-2.2.15-60.el6.centos.4.x86_64 ya se encuentra instalado con su versión más reciente
    Nada para hacer
    Creating virtual environment...
    Installing Python packages...
    Had a problem while installing Python packages.

pip prints the following errors:

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Exception:
Traceback (most recent call last):
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/commands/install.py", line 272, in run
with self._build_session(options) as session:
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/download.py", line 329, in init
self.headers["User-Agent"] = user_agent()
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py", line 1050, in
_distro = LinuxDistribution()
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py", line 594, in init
if include_lsb else {}
File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py", line 922, in _get_lsb_release_info
stdout, stderr = stdout.decode('utf-8'), stderr.decode('utf-8')
File "/root/.local/share/letsencrypt/lib64/python2.6/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 35: invalid continuation byte

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip
output.

Consult Get Certbot — Certbot 2.12.0.dev0 documentation
for possible solutions.
You may also find some support resources at https://certbot.eff.org/support/ .

lsb_release -a
-bash: lsb_release: no se encontró la orden

Huh, that’s strange. Could you try directly running

python /root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/distro.py

?

The directory /root/.local is empty

I don’t know why.

Is there the possibility to deinstall and reinstall all?

Regards

@bmw, I’m confused about this on multiple accounts… could you take a look?

① Why would lsb_release print non-ASCII text in its output?

② Why would distro.py try to parse the output of lsb_release if it’s not even installed? It has code specifically to check for this case.

③ Why would /root/.local be empty after so much certbot-auto stuff was just run from within it?

Hello,

i done a test on another VPS with CentOS 7.3 64bit and Python 2.7 with a fresh certbot-auto installation and the result it’s the same:

./certbot-auto
Bootstrapping dependencies for RedHat-based OSes… (you can skip this with --no-bootstrap)
yum is /usr/bin/yum
Complementos cargados:fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.linode.com
  • epel: pubmirror1.math.uh.edu
  • extras: mirrors.linode.com
  • updates: mirrors.linode.com
    El paquete gcc-4.8.5-11.el7.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete 1:openssl-1.0.1e-60.el7_3.1.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete 1:openssl-devel-1.0.1e-60.el7_3.1.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete ca-certificates-2017.2.14-70.1.el7_3.noarch ya se encuentra instalado con su versión más reciente
    El paquete python-2.7.5-48.el7.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete python-devel-2.7.5-48.el7.x86_64 ya se encuentra instalado con su versión más reciente
    El paquete 1:mod_ssl-2.4.6-45.el7.centos.4.x86_64 ya se encuentra instalado con su versión más reciente
    Resolviendo dependencias
    –> Ejecutando prueba de transacción
    —> Paquete augeas-libs.x86_64 0:1.4.0-2.el7 debe ser instalado
    —> Paquete libffi-devel.x86_64 0:3.0.13-18.el7 debe ser instalado
    —> Paquete python-tools.x86_64 0:2.7.5-48.el7 debe ser instalado
    –> Procesando dependencias: tkinter = 2.7.5-48.el7 para el paquete: python-tools-2.7.5-48.el7.x86_64
    —> Paquete python-virtualenv.noarch 0:1.10.1-3.el7 debe ser instalado
    —> Paquete python2-pip.noarch 0:8.1.2-5.el7 debe ser instalado
    —> Paquete redhat-rpm-config.noarch 0:9.1.0-72.el7.centos debe ser instalado
    –> Procesando dependencias: dwz >= 0.4 para el paquete: redhat-rpm-config-9.1.0-72.el7.centos.noarch
    –> Procesando dependencias: zip para el paquete: redhat-rpm-config-9.1.0-72.el7.centos.noarch
    –> Procesando dependencias: perl-srpm-macros para el paquete: redhat-rpm-config-9.1.0-72.el7.centos.noarch
    –> Ejecutando prueba de transacción
    —> Paquete dwz.x86_64 0:0.11-3.el7 debe ser instalado
    —> Paquete perl-srpm-macros.noarch 0:1-8.el7 debe ser instalado
    —> Paquete tkinter.x86_64 0:2.7.5-48.el7 debe ser instalado
    –> Procesando dependencias: libtk8.5.so()(64bit) para el paquete: tkinter-2.7.5-48.el7.x86_64
    –> Procesando dependencias: libtcl8.5.so()(64bit) para el paquete: tkinter-2.7.5-48.el7.x86_64
    –> Procesando dependencias: libTix.so()(64bit) para el paquete: tkinter-2.7.5-48.el7.x86_64
    —> Paquete zip.x86_64 0:3.0-11.el7 debe ser instalado
    –> Ejecutando prueba de transacción
    —> Paquete tcl.x86_64 1:8.5.13-8.el7 debe ser instalado
    —> Paquete tix.x86_64 1:8.4.3-12.el7 debe ser instalado
    —> Paquete tk.x86_64 1:8.5.13-6.el7 debe ser instalado
    –> Resolución de dependencias finalizada

Dependencias resueltas

================================================================================================================================================================================================
Package Arquitectura Versión Repositorio Tamaño

Instalando:
augeas-libs x86_64 1.4.0-2.el7 base 355 k
libffi-devel x86_64 3.0.13-18.el7 base 23 k
python-tools x86_64 2.7.5-48.el7 base 852 k
python-virtualenv noarch 1.10.1-3.el7 base 1.2 M
python2-pip noarch 8.1.2-5.el7 epel 1.7 M
redhat-rpm-config noarch 9.1.0-72.el7.centos base 78 k
Instalando para las dependencias:
dwz x86_64 0.11-3.el7 base 99 k
perl-srpm-macros noarch 1-8.el7 base 4.6 k
tcl x86_64 1:8.5.13-8.el7 base 1.9 M
tix x86_64 1:8.4.3-12.el7 base 254 k
tk x86_64 1:8.5.13-6.el7 base 1.4 M
tkinter x86_64 2.7.5-48.el7 base 322 k
zip x86_64 3.0-11.el7 base 260 k

Resumen de la transacción

Instalar 6 Paquetes (+7 Paquetes dependientes)

Tamaño total de la descarga: 8.4 M
Tamaño instalado: 24 M
Is this ok [y/d/N]: y
Downloading packages:
(1/13): dwz-0.11-3.el7.x86_64.rpm | 99 kB 00:00:00
(2/13): libffi-devel-3.0.13-18.el7.x86_64.rpm | 23 kB 00:00:00
(3/13): augeas-libs-1.4.0-2.el7.x86_64.rpm | 355 kB 00:00:00
(4/13): perl-srpm-macros-1-8.el7.noarch.rpm | 4.6 kB 00:00:00
(5/13): python-tools-2.7.5-48.el7.x86_64.rpm | 852 kB 00:00:00
(6/13): redhat-rpm-config-9.1.0-72.el7.centos.noarch.rpm | 78 kB 00:00:00
(7/13): python-virtualenv-1.10.1-3.el7.noarch.rpm | 1.2 MB 00:00:00
(8/13): tix-8.4.3-12.el7.x86_64.rpm | 254 kB 00:00:00
(9/13): tcl-8.5.13-8.el7.x86_64.rpm | 1.9 MB 00:00:00
(10/13): tk-8.5.13-6.el7.x86_64.rpm | 1.4 MB 00:00:00
(11/13): zip-3.0-11.el7.x86_64.rpm | 260 kB 00:00:00
(12/13): tkinter-2.7.5-48.el7.x86_64.rpm | 322 kB 00:00:00
python2-pip-8.1.2-5.el7.noarch FAILED
http://mirror.math.princeton.edu/pub/epel/7/x86_64/p/python2-pip-8.1.2-5.el7.noarch.rpm: [Errno 12] Timeout on http://mirror.math.princeton.edu/pub/epel/7/x86_64/p/python2-pip-8.1.2-5.el7.noarch.rpm: (28, ‘Connection timed out after 30000 milliseconds’)
Intentando con otro espejo.
(13/13): python2-pip-8.1.2-5.el7.noarch.rpm | 1.7 MB 00:00:01

Total 271 kB/s | 8.4 MB 00:00:31
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Instalando : 1:tcl-8.5.13-8.el7.x86_64 1/13
Instalando : 1:tk-8.5.13-6.el7.x86_64 2/13
Instalando : 1:tix-8.4.3-12.el7.x86_64 3/13
Instalando : tkinter-2.7.5-48.el7.x86_64 4/13
Instalando : perl-srpm-macros-1-8.el7.noarch 5/13
Instalando : dwz-0.11-3.el7.x86_64 6/13
Instalando : zip-3.0-11.el7.x86_64 7/13
Instalando : redhat-rpm-config-9.1.0-72.el7.centos.noarch 8/13
Instalando : python-tools-2.7.5-48.el7.x86_64 9/13
Instalando : augeas-libs-1.4.0-2.el7.x86_64 10/13
Instalando : python2-pip-8.1.2-5.el7.noarch 11/13
Instalando : libffi-devel-3.0.13-18.el7.x86_64 12/13
Instalando : python-virtualenv-1.10.1-3.el7.noarch 13/13
Comprobando : python-virtualenv-1.10.1-3.el7.noarch 1/13
Comprobando : python-tools-2.7.5-48.el7.x86_64 2/13
Comprobando : libffi-devel-3.0.13-18.el7.x86_64 3/13
Comprobando : 1:tcl-8.5.13-8.el7.x86_64 4/13
Comprobando : python2-pip-8.1.2-5.el7.noarch 5/13
Comprobando : redhat-rpm-config-9.1.0-72.el7.centos.noarch 6/13
Comprobando : zip-3.0-11.el7.x86_64 7/13
Comprobando : dwz-0.11-3.el7.x86_64 8/13
Comprobando : tkinter-2.7.5-48.el7.x86_64 9/13
Comprobando : 1:tk-8.5.13-6.el7.x86_64 10/13
Comprobando : perl-srpm-macros-1-8.el7.noarch 11/13
Comprobando : augeas-libs-1.4.0-2.el7.x86_64 12/13
Comprobando : 1:tix-8.4.3-12.el7.x86_64 13/13

Instalado:
augeas-libs.x86_64 0:1.4.0-2.el7 libffi-devel.x86_64 0:3.0.13-18.el7 python-tools.x86_64 0:2.7.5-48.el7 python-virtualenv.noarch 0:1.10.1-3.el7
python2-pip.noarch 0:8.1.2-5.el7 redhat-rpm-config.noarch 0:9.1.0-72.el7.centos

Dependencia(s) instalada(s):
dwz.x86_64 0:0.11-3.el7 perl-srpm-macros.noarch 0:1-8.el7 tcl.x86_64 1:8.5.13-8.el7 tix.x86_64 1:8.4.3-12.el7 tk.x86_64 1:8.5.13-6.el7 tkinter.x86_64 0:2.7.5-48.el7 zip.x86_64 0:3.0-11.el7

¡Listo!
Creating virtual environment…
Installing Python packages…
Had a problem while installing Python packages.

pip prints the following errors:

Exception:
Traceback (most recent call last):
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/commands/install.py”, line 272, in run
with self._build_session(options) as session:
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/basecommand.py”, line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/download.py”, line 329, in init
self.headers[“User-Agent”] = user_agent()
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/download.py”, line 93, in user_agent
from pip._vendor import distro
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/_vendor/distro.py”, line 1050, in
_distro = LinuxDistribution()
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/_vendor/distro.py”, line 594, in init
if include_lsb else {}
File “/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/_vendor/distro.py”, line 922, in _get_lsb_release_info
stdout, stderr = stdout.decode(‘utf-8’), stderr.decode(‘utf-8’)
File “/root/.local/share/letsencrypt/lib64/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 0xf3 in position 35: invalid continuation byte

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip
output.

Consult https://certbot.eff.org/docs/install.html#problems-with-python-virtual-environment
for possible solutions.
You may also find some support resources at https://certbot.eff.org/support/ .

The problem SOLVED changing locale configuration to en_US.UTF-8 from es_CO.iso88591
Regards

I’m glad you were able to solve it! The fact that this worked suggests to me that the problem relates to the “ó” in the phrase “no se encontró la orden” (because in Python 2 non-ASCII characters aren’t permitted in this particular context).

I looked more closely at the code in distro.py and I realized that it is a subtle logic bug related to this! It’s in code that we didn’t write but do rely on. I will try to get in touch with the people who wrote the code and get it fixed.

When I went to report the bug, I found that it was already known and fixed:

@bmw, can you say anything about the circumstances where users will have versions of pip that don’t include the fix for this bug?

Since our release at the beginning of August, we install pip 9.0.1 which should include a fix for this. The problem may be occurring when we try to install the new pip version though.

If you can reproduce, I’d be interested to know the instructions for doing so, the output of grep -m1 LE_AUTO_VERSION /path/to/certbot-auto, and the output of path/to/certbot-auto --verbose.

grep -m1 LE_AUTO_VERSION /usr/local/bin/certbot-auto

LE_AUTO_VERSION=“0.17.0”

/usr/local/bin/certbot-auto --verbose

Root logging level set at 10
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requested authenticator None and installer None
Apache version is 2.2.15
Single candidate plugin: * apache
Description: Apache Web Server plugin - Beta
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.configurator:ApacheConfigurator
Initialized: <certbot_apache.configurator.ApacheConfigurator object at 0x2efa4d0>
Prep: True
Selected authenticator <certbot_apache.configurator.ApacheConfigurator object at 0x2efa4d0> and installer <certbot_apache.configurator.ApacheConfigurator object at 0x2efa4d0>
Picked account: <Account(RegistrationResource(body=Registration(status=None, contact=(u’mailto:admin@voztovoice.org’,), agreement=u’https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf’, key=JWKRSA(key=<ComparableRSAKey(<cryptography.hazmat.backends.openssl.rsa._RSAPublicKey object at 0x3119c90>)>)), uri=u’https://acme-v01.api.letsencrypt.org/acme/reg/38926’, new_authzr_uri=u’https://acme-v01.api.letsencrypt.org/acme/new-authz’, terms_of_service=u’https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf’), 39204af6bd831c29edf95c75eb1d83c2, Meta(creation_host=u’voztovoice.org’, creation_dt=datetime.datetime(2015, 12, 4, 19, 16, 22, tzinfo=)))>
Sending GET request to https://acme-v01.api.letsencrypt.org/directory.
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
https://acme-v01.api.letsencrypt.org:443 “GET /directory HTTP/1.1” 200 460
Received response:
HTTP 200
Server: nginx
Content-Type: application/json
Content-Length: 460
Boulder-Request-Id: ma0jucC4kYyjxyiEpaZVyfwjAjnv_hpGsMwOIkz8-Cs
Replay-Nonce: BzR_ZQ2Ww–iXpInAjalq-19IldMttBUzuSPKn2p3sY
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
Expires: Mon, 21 Aug 2017 18:28:42 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Mon, 21 Aug 2017 18:28:42 GMT
Connection: keep-alive

{
“key-change”: “https://acme-v01.api.letsencrypt.org/acme/key-change”,
“meta”: {
“terms-of-service”: “https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf
},
“new-authz”: “https://acme-v01.api.letsencrypt.org/acme/new-authz”,
“new-cert”: “https://acme-v01.api.letsencrypt.org/acme/new-cert”,
“new-reg”: “https://acme-v01.api.letsencrypt.org/acme/new-reg”,
“revoke-cert”: “https://acme-v01.api.letsencrypt.org/acme/revoke-cert
}

Which names would you like to activate HTTPS for?

PIP version is 7.1.0

Regards

Thanks for the additional information.

If I run:

LANG=es_CO.iso88591 ./certbot-auto --verbose

using the official CentOS 6.9 Docker image, I’m unable to reproduce. I’m glad you got it working though.

If anyone can reproduce, please provide instructions for doing so and/or provide the full output from ./certbot-auto --verbose.

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