# Unexpected error: 'utf-8' codec can't decode byte 0xe3 in position 18: invalid continuation byte

**URL:** <https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641>\
**Category:** Help\
**Created:** [May 4, 2020, 2:29pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641 "2020-05-04T14:29:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 2:29pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/1 "2020-05-04T14:29:19Z")

</div>

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. [https://crt.sh/?q=example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:jjw.com.br

I ran this command: certbot renew

It produced this output:

```
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/integrador.jjw.com.br.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/portal.jjw.com.br.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/jjw.com.br.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator manual, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for jjw.com.br
http-01 challenge for www.jjw.com.br
Cleaning up challenges
Encountered exception during recovery:
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 132, in _solve_challenges
    resp = self.auth.perform(all_achalls)
  File "/usr/lib/python3/dist-packages/certbot/plugins/manual.py", line 169, in perform
    perform_achall(achall)
  File "/usr/lib/python3/dist-packages/certbot/plugins/manual.py", line 205, in _perform_achall_with_script
    _, out = hooks.execute(self.conf('auth-hook'))
  File "/usr/lib/python3/dist-packages/certbot/hooks.py", line 245, in execute
    out, err = cmd.communicate()
  File "/usr/lib/python3.4/subprocess.py", line 960, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.4/subprocess.py", line 1659, in _communicate
    self.stdout.encoding)
  File "/usr/lib/python3.4/subprocess.py", line 888, in _translate_newlines
    data = data.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 18: invalid continuation byte

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 316, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python3/dist-packages/certbot/plugins/manual.py", line 242, in cleanup
    env = self.env.pop(achall)
KeyError: KeyAuthorizationAnnotatedChallenge(challb=ChallengeBody(chall=HTTP01(token=b'\xad\x86rw-\xaaA\xf4\xb8X\x99\xea\x9c\x85e\xbb\xcf/\xd9\x83\x04\xa1\xc9\xb4v\x95,4\xe9Ls\x8d'), uri='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4352617991/FtJzdQ', status=Status(pending), error=None, validated=None, _url='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4352617991/FtJzdQ'), domain='jjw.com.br', account_key=JWKRSA(key=<ComparableRSAKey(<cryptography.hazmat.backends.openssl.rsa._RSAPrivateKey object at 0x7f13046a06a0>)>))
Attempting to renew cert (jjw.com.br) from /etc/letsencrypt/renewal/jjw.com.br.conf produced an unexpected error: 'utf-8' codec can't decode byte 0xe3 in position 18: invalid continuation byte. Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/jjw.com.br/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/integrador.jjw.com.br/fullchain.pem expires on 2020-07-15 (skipped)
  /etc/letsencrypt/live/portal.jjw.com.br/fullchain.pem expires on 2020-06-08 (skipped)
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/jjw.com.br/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

```

My web server is (include version):

The operating system my web server runs on is (include version): Ubuntu 14.04.5 LTS

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): 0.28.0

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [May 4, 2020, 3:15pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/2 "2020-05-04T15:15:54Z")

</div>

My first suggestion would be to update your O/S.  
Ubuntu 14.04.05 LTS reached end of standard support in April of last year.

My second suggestion is to try to update the certbot client - but that might be the latest on that dist.

My last suggestion (if those two can’t be done or don’t fix the problem) would be to use an alternate ACME client - like [acme.sh](https://github.com/acmesh-official/acme.sh) or [`certbot-auto`](https://certbot.eff.org/docs/install.html#certbot-auto)

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [May 4, 2020, 3:20pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/3 "2020-05-04T15:20:23Z")

</div>

Hi @jjw.roberto

> [@jjw.roberto](#):
>
> codec can't decode byte 0xe3 in position 18

0xe3 is 227, may be ã as unicode code point, may be another char (code page specific). May be you have that char in one of your config files, code or comment.

Check that and remove / change that character.

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 4:24pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/4 "2020-05-04T16:24:37Z")

</div>

This is my config  
 ![image](https://global.discourse-cdn.com/letsencrypt/original/3X/7/a/7afd54d0438f60075afe40e02e2c333dd5dcfe15.png)

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 4:36pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/5 "2020-05-04T16:36:37Z")

</div>

I have noted that the response of the CERT\_TOKEN file are returning the Content-Type as text/plain charset=ISO-8859-1, but the real content of the file is UTF-8.

Can this be the problem?

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [May 4, 2020, 4:46pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/6 "2020-05-04T16:46:54Z")

</div>

What exactly does the manual auth hook output? Is it valid UTF-8? What’s in position 18?

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [May 4, 2020, 5:44pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/7 "2020-05-04T17:44:50Z")

</div>

Is it possible that you’ve edited one of your configuration files with an editor that included non-ASCII characters in them?

Could you run `grep -P '[\x80-\xFF]'` on this file or other relevant files to see if it finds anything?

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 6:35pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/8 "2020-05-04T18:35:38Z")

</div>

The GREP command returns nothing.

And this is the char 18 in the config file (the char “i”):

 ![image](https://global.discourse-cdn.com/letsencrypt/original/3X/3/f/3fc1afcac0a4b5e7572a015ca3bfcd1d02eecae4.png)

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [May 4, 2020, 6:38pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/9 "2020-05-04T18:38:23Z")

</div>

What’s character 18 in the stderr or stdout output from your manual auth hook program?

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 8:02pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/10 "2020-05-04T20:02:14Z")

</div>

> [@mnordhoff](#):
>
> auth

This is my "ftp-put.sh" script:

```
ftp -n << EOF
open ftp03.tpa.com.br
user USER PASSWORD
pass
bin
cd web
mkdir .well-known
cd .well-known
mkdir acme-challenge
cd acme-challenge
put $CERTBOT_TOKEN
EOF

```

The char 18 is the "space" after the "open" command:

```
open ftp03.tpa.com.br
    ^

```

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [May 4, 2020, 8:12pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/11 "2020-05-04T20:12:14Z")

</div>

There

> [@jjw.roberto](#):
>
> open ftp03.tpa.com.br

you have your problem - checking your domain - the portcheck part, there is an ftp check - [https://check-your-website.server-daten.de/?q=ftp03.tpa.com.br#portchecks](https://check-your-website.server-daten.de/?q=ftp03.tpa.com.br#portchecks)

> 220-Bem-vindo a Pure-FTPd. 220-Voc? ? o usu?rio n?mero 5 de 150 permitidos 220-Hora local agora ? 17:09. Porta do servidor: 21. 220-Este ? um sistema privado - N?o ? permitido usu?rio an?nimo 220-Conex?es IPv6 tamb?m s?o bem-vindas neste servidor 220 Voc? ser? desconectado ap?s 15 minutos de inatividade.

Looks like a missing code information.

Checked manual (telnet):

> 220-Bem-vindo a Pure-FTPd.  
> 220-VocÛ Ú o usußrio n·mero 4 de 150 permitidos  
> 220-Hora local agora Ú 17:04. Porta do servidor: 21.  
> 220-Este Ú um sistema privado - NÒo Ú permitido usußrio an¶nimo  
> 220-Conex§es IPv6 tambÚm sÒo bem-vindas neste servidor  
> 220 VocÛ serß desconectado ap¾s 15 minutos de inatividade.

A lot of chars not in ASCII.

PS: The output is important, not the script.

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 8:30pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/12 "2020-05-04T20:30:37Z")

</div>

> [@JuergenAuer](#):
>
> ot the script

How can I solve it? This output has no importance for me....

---

<div class="post-metadata">

**Author:** ![jjw.roberto](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jjw.roberto](https://community.letsencrypt.org/u/jjw.roberto)\
**Post date:** [May 4, 2020, 9:12pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/13 "2020-05-04T21:12:14Z")

</div>

> [@JuergenAuer](#):
>
> is an ftp check -

Solved, I changed my script to this:

```
ftp -i -n << EOF > /dev/null
open ftp03.tpa.com.br 
...

```

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [May 4, 2020, 9:49pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/14 "2020-05-04T21:49:36Z")

</div>

This is probably a bug in Certbot because it doesn’t seem inappropriate to have non-ASCII output from a hook script, but good job finding a working solution for your situation!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [June 3, 2020, 9:49pm UTC](https://community.letsencrypt.org/t/unexpected-error-utf-8-codec-cant-decode-byte-0xe3-in-position-18-invalid-continuation-byte/121641/15 "2020-06-03T21:49:43Z")

</div>

Closed on June 3, 2020, 9:49pm UTC

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