Ascii codec can't decode byte 0xd0 in position

I’m getting this message and found the traceback in the web.log from frappe.


No clue as how else to solve it, I have tried the locale settings and no luck
Some posts suggest removing non UTF chars from my apps, but I have another instance of ERPNext v12 running perfectly well with them.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/www/", line 21, in get_context
    boot = frappe.sessions.get()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 130, in get
    bootinfo = get_bootinfo()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 54, in get_bootinfo
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 193, in load_translations
    messages = frappe.get_lang_dict("boot")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 90, in get_lang_dict
    return get_dict(fortype, name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 114, in get_dict
    messages = get_messages_from_include_files()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 474, in get_messages_from_include_files
    messages.extend(get_messages_from_file(os.path.join(frappe.local.sites_path, file)))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 502, in get_messages_from_file
    message) for message in  extract_messages_from_code(, path.endswith(".py"))]
  File "/home/frappe/frappe-bench/env/lib/python3.6/encodings/", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1801299: ordinal not in range(128)

Frappe will load the website and allow me to enter my password and user, but then I get this.

So far my workaround (not a direct solution per se) involved creating a new server and restoring a backup.

I faced the similar issue.
Root cause: What I found was the locale was not installed and configured properly. For me I picked up ubuntu-minimal:18:04 over container which obviously doesn’t have many assumed packages.
Steps I took to resolve.

  • in bash within root or with sudo (if available)…
    apt clean && apt update && apt install -y locales
    locale-gen en_US.UTF-8 # for to be sure of locales available 
    dpkg-reconfigure locales
  • choose a UTF-8 locale. say: en_US.UTF-8, en_IN.UTF-8 (Indian EN), hi_IN.UTF-8 (hindi/India)
  • run locale command in bash and should not pop-up any error.
  • restart server/container(lxd/docker) whereever frappe app is installed.
    Hopefully now the issue should go away!