Bench Manager not listing my Sites UnicodeDecodeError: ‘ascii’ codec

Hello

Issues with bench manager not listing sites after reinstall. immediately after login i get error message below.

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 290, in _save
self.run_before_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run_before_save_methods
self.run_method(“validate”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 29, in validate
sync_all(in_background=True)
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 223, in sync_all
sync_sites()
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 63, in sync_sites
site_dirs = update_site_list()
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 114, in update_site_list
for root, dirs, files in os.walk(“.”, topdown=True):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 284, in walk
if isdir(join(top, name)):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 14: ordinal not in range(128)

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 290, in _save
self.run_before_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run_before_save_methods
self.run_method(“validate”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 29, in validate
sync_all(in_background=True)
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 223, in sync_all
sync_sites()
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 63, in sync_sites
site_dirs = update_site_list()
File “/home/ubuntu/frappe-bench/apps/bench_manager/bench_manager/bench_manager/doctype/bench_settings/bench_settings.py”, line 114, in update_site_list
for root, dirs, files in os.walk(“.”, topdown=True):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 294, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/os.py”, line 284, in walk
if isdir(join(top, name)):
File “/home/ubuntu/frappe-bench/env/lib/python2.7/posixpath.py”, line 80, in join
path += ‘/’ + b
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 14: ordinal not in range(128)

@clarkej please will appreciate your help

One of your directories has an ‘unrecognized’ character say ñ ?

This explains more python - UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128) - Stack Overflow

To find it this may help

frappe@erpnext:~/frappe-bench$ mkdir sites/ñññ
frappe@erpnext:~/frappe-bench$ find . -type d | grep -P -n '[^\x00-\x7F]'
2822:./sites/ñññ

Hi clarkej,
I am getting the same issue, but I couldn’t find any of my directory having ñ character.

Don’t just limit your search to directory names with ñ - do check for all non-ascii characters in both directories and filenames.

In my previous post the find expression code was just a search to find ñ as a test!

@clarkej @mtajammul i guess your problem seems to to be not defining utf character set in perl as this was my problem before with dropbox and bench manager, both throw the same error as yours only different is the character that it recognizes is different ( different ascii code), may be you are using another language next to english, if so you could just add it to perl as utf language and it will automatically fix things for you
this link will explain more and guide you more Dropbox Backup question - UnicodeDecodeError arabic locale - #24 by a.elhaidary just check what other language you are using and add it, hope it helps and may fix your problem

1 Like