UnicodeEncodeError while expanding cerificate


Whats the problem with the following code?

My domain is: zabanshenas.com, talk.zabanshenas.com

I ran this command:

/usr/local/certbot/certbot-auto -t --renew-by-default --agree-tos --webroot -w /etc/letsencrypt/webroot --server https://acme-v01.api.letsencrypt.org/directory -m eng.hnaseri@gmail.com --expand -d zabanshenas.com,www.zabanshenas.com,talk.zabanshenas.com,www.talk.zabanshenas.com certonly

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for zabanshenas.com
http-01 challenge for www.zabanshenas.com
http-01 challenge for talk.zabanshenas.com
http-01 challenge for www.talk.zabanshenas.com
Using the webroot path /etc/letsencrypt/webroot for all unmatched domains.
Waiting for verification...
Cleaning up challenges
An unexpected error occurred:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 276-280: ordinal not in range(128)
Please see the logfiles in /var/log/letsencrypt for more details.

Error while adding a subdomain

btw my sudomain runs a discourse forum. Should I share this problem as bug with them or is it something related to my configurations? or is it a known bug in certbot?


Are there more details in /var/log/letsencrypt ?

This is often where a config file has been edited via windows or something that has left an unusual character (for linux) in there


yes I just saw this one:

Connection: keep-alive

  "identifier": {
    "type": "dns",
    "value": "talk.zabanshenas.com"
  "status": "invalid",
  "expires": "2017-03-07T16:05:55Z",
  "challenges": [
      "type": "http-01",
      "status": "invalid",
      "error": {
        "type": "urn:acme:error:unauthorized",
        "detail": "Invalid response from http://talk.zabanshenas.com/.well-known/acme-challenge/8kKTJhJa6T5wYMWrEwfr7x1wO2FtcNPMaTTMA27z1uA: \"\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"fa_IR\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003ctitle\u003eتالار گفتگوی زبانشناس\u003c/title\u003e\n  \"",
        "status": 403
      "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/nGX6UgiEhQuhvK2pepOD1CzEo_lDT8uJMhdN5kVsPcs/721021096",
      "token": "8kKTJhJa6T5wYMWrEwfr7x1wO2FtcNPMaTTMA27z1uA",
      "keyAuthorization": "8kKTJhJa6T5wYMWrEwfr7x1wO2FtcNPMaTTMA27z1uA.r0qlFPMFiCBamDTfSNzAVpzO7S2Jc0o24DFp9qugoi4",
      "validationRecord": [
          "url": "http://talk.zabanshenas.com/.well-known/acme-challenge/8kKTJhJa6T5wYMWrEwfr7x1wO2FtcNPMaTTMA27z1uA",
          "hostname": "talk.zabanshenas.com",
          "port": "80",
          "addressesResolved": [
          "addressUsed": ""
      "type": "tls-sni-01",
      "status": "pending",
      "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/nGX6UgiEhQuhvK2pepOD1CzEo_lDT8uJMhdN5kVsPcs/721021097",
      "token": "I5z68TxguVuSq1iEAuwD53Pcs2W1D32fYP6zzJjRQn8"
      "type": "dns-01",
      "status": "pending",
      "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/nGX6UgiEhQuhvK2pepOD1CzEo_lDT8uJMhdN5kVsPcs/721021098",
      "token": "YGYDDF06PNYfv9Kj2E6YNKzACqOBbchJGKxvyY0Cmgo"
  "combinations": [


It would be in the log file related to

rather than the part of the log file you have pasted.


how should i find that?

btw whats about this invalid response in my log?


please paste the complete /var/log/letsencrypt file into pastebin.com or other suitable place (or clear the file, and try again, and pste it from a single attempt).

This is when the acme server tried to go to http://talk.zabanshenas.com/.well-known/acme-challenge/8kKTJhJa6T5wYMWrEwfr7x1wO2FtcNPMaTTMA27z1uA (the link it says in the message) it was expecting to get a token back (such as FtcNPMaTTMA27z1uA8kKTJhJa6T5wYMWrEwfr7x1w ). Instead it got a 404 page and a lot of HTML which it shouldn’t have got.


here you are http://pastebin.com/mYK2uCdV


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