Certbot UnicodeDecodeError


#1

My domain is:rruv.com.mx

I ran this command: Certbot-auto certonly

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 44 of /etc/apache2/sites-enabled/000-default-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory

How would you like to authenticate with the ACME CA?

1: Apache Web Server plugin - Beta (apache) [Misconfigured]
2: Nginx Web Server plugin - Alpha (nginx)
3: Spin up a temporary webserver (standalone)
4: Place files in webroot directory (webroot)

Select the appropriate number [1-4] then [enter] (press ‘c’ to cancel):

I selected 2

Select the appropriate number [1-4] then [enter] (press ‘c’ to cancel): 2
Plugins selected: Authenticator nginx, Installer None
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c’
to cancel): uva.rruv.com.mx

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for uva.rruv.com.mx
Cleaning up challenges
nginx: [warn] conflicting server name “rruv.com.mx” on 0.0.0.0:443, ignored
An unexpected error occurred:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 5: ordinal not in range(128)
Please see the logfiles in /var/log/letsencrypt for more details.

My web server is (include version): Nginx

The operating system my web server runs on is (include version):Ubuntu Server 14.04

I haven’t to create a new certificate. I need help.


#2

Hi @G3orgx,

It looks like you have some non-ASCII characters (maybe ñ or something) in a file in a way that confuses Certbot. This is definitely a bug in Certbot in this case because it should be willing to accept these characters without getting confused.

Several bugs related to this have been fixed in the past, but it appears that you’ve found another one that will still need to be fixed now. Since you’re using certbot-auto, you probably already have the most recent version of Certbot, so I can’t simply suggest fixing this by upgrading to a newer version. :frowning:

Can you help find what the non-ASCII character in question is by looking at the files that were mentioned here?

One thing to help search for these quickly is grep -P '[^\x00-\x7f]', for example

grep -r -P '[^\x00-\x7f]' /etc/apache2 /etc/letsencrypt

If you find this character, maybe you can post the associated file so that we can better understand the nature of this bug and try to fix it.

Once you’ve found it, you can probably get your certificate right away by deleting the non-ASCII character (although of course you shouldn’t have to do that in general, it may be necessary right now as a temporary workaround). If you need a certificate quickly, you could also try one of the other clients

which might not have the same bug. Most of the other clients are not quite as integrated with Apache, so for example they will not edit your Apache configuration for you to install the certificate after it’s been issued, the way Certbot does.


#3

I also noticed that you appear to have both Apache and nginx installed at the same time and that it appears that you previously used Certbot to configure Apache (unsuccessfully) and are now trying to use it to configure nginx. This might be adding to the problems here; is it clear to you which of the two webservers you want Certbot to configure?


#4

oh sure, I’m using nginx


#5

So, maybe Certbot’s code to detect if Apache is installed had problems with your Apache configuration.

Could you try to use grep to find non-ASCII characters in both your Apache configuration and your nginx configuration and let us know which ones you find? Then I can try to investigate getting this behavior fixed in Certbot.


#6

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