Autocomplete error for contacts when sharing e.g. task

When I press the first letter (in greek) this error occurs.
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 942, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py”, line 15, in get_contact_list
cached_contacts = get_cached_contacts(txt)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py”, line 92, in get_cached_contacts
match = [d for d in contacts if (txt in d.value or txt in d.description)]
TypeError: argument of type ‘NoneType’ is not iterable

Could you please share some screenshots or GIF indicating this issue please? Also, mention the version of your ERPNext account.

ERPNext: v11.x.x-develop (78a2d97) (develop)

Frappe Framework: v11.x.x-develop (cfc7661) (develop)

image

image

even though I press d in greek (delta). Database encoding maybe

@surajshetty could you please check? If needed please create Github issue for it.

Any luck?

Maybe this might help . Something wrong with get_contact_list

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 942, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py”, line 15, in get_contact_list
cached_contacts = get_cached_contacts(txt)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py”, line 92, in get_cached_contacts
match = [d for d in contacts if (txt in d.value or txt in d.description)]
TypeError: argument of type ‘NoneType’ is not iterable

An error that might has something to do with the above
{‘retry’: 0, ‘log’: <function log at 0x7f4cc6ad4230>, ‘site’: u’site1.local’, ‘event’: u’daily’, ‘method_name’: u’erpnext.setup.doctype.email_digest.email_digest.send’, ‘method’: <function send at 0x7f4cc6a6bb90>, ‘user’: u’Administrator’, ‘kwargs’: {}, ‘async’: True, ‘job_name’: u’erpnext.setup.doctype.email_digest.email_digest.send’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 97, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 536, in send
ed_obj.send()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 57, in send
msg_for_this_recipient = self.get_msg_html()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 80, in get_msg_html
self.set_accounting_cards(context)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 244, in set_accounting_cards
card = frappe.dict(getattr(self, "get" + key)())
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 329, in get_expenses_booked
expense, past_expense, count = self.get_period_amounts(self.get_root_type_accounts(“expense”), ‘expenses_booked’)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py”, line 343, in get_period_amounts
balance += (get_balance_on(account, date = self.future_to_date)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/utils.py”, line 156, in get_balance_on
WHERE {1}“”".format(select_field, " and ".join(cond)))[0][0]
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 139-147: ordinal not in range(128)

Just found by logging in as admin
Error Report
Python 2.7.15rc1: /home/frappe/frappe-bench/env/bin/python (prefix: /home/frappe/frappe-bench/env)

Timestamp:
2018-06-03 08:35:09.116639
Relapsed
28
Exception
args (“argument of type ‘NoneType’ is not iterable”,)
message “argument of type ‘NoneType’ is not iterable”
Locals
contacts [{u’description’: u’\u2019\u03b3\u03b3\u03b5\u03b…3\u03ba\u03b1\u03c1\u03b7\u03c2’, u’value’: None}, {u’description’: u’\u2019\u03bd\u03bd\u03b1 \u03…1\u03bc\u03c0\u03af\u03c1\u03b7’, u’value’: None}, {u’description’: u’\u2019\u03bd\u03bd\u03b1 \u039c\u03c0\u03bf\u03bb\u03ba\u03b1’, u’value’: None}, {u’description’: u’\u0394\u0395\u03a5\u0391\u039…a\u03ad\u03bd\u03c4\u03c1\u03bf’, u’value’: None}, {u’description’: u’Dimitris Andavoglou’, u’value’: u’dimitrisand@gmail.com’}, {u’description’: u’Dimos Toulkidis’, u’value’: None}, {u’description’: u’Emmanuil Sordakis’, u’value’: None}, {u’description’: u’Evernote Notes’, u’value’: None}, {u’description’: u’Givova Hellas’, u’value’: None}, {u’description’: u’Guest’, u’value’: u’Guest’}, {u’description’: u’info@nortech.gr’, u’value’: None}, {u’description’: u’Intec Systems’, u’value’: u’da@intecsystems.gr’}, {u’description’: u’intecsystems@outlook.com’, u’value’: None}, {u’description’: u’IOANNIS. D. ASTERIADIS’, u’value’: None}, {u’description’: u’Johan Tulen’, u’value’: None}, {u’description’: u’katelefth-42908 \u0395\u03bb.…1\u03b9\u03ac\u03b4\u03bf\u03c5’, u’value’: None}, {u’description’: u’Lioncode Web’, u’value’: None}, {u’description’: u’Marc Haid’, u’value’: None}, {u’description’: u’Michalis M.‘, u’value’: None}, {u’description’: u’\u0398\u03bf\u03b4\u03c9\u03c…u03c2’, u’value’: u’nikolopoulost@unisystems.gr’}]
d {u’description’: u’\u2019\u03b3\u03b3\u03b5\u03b…3\u03ba\u03b1\u03c1\u03b7\u03c2’, u’value’: None}
txt u’da’
Traceback
/home/frappe/frappe-bench/apps/frappe/frappe/app.py: 62

60
61 if frappe.local.form_dict.cmd:
62 response = frappe.handler.handle()
63
64 elif frappe.request.path.startswith(“/api/”):
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 22

20
21 if cmd!=‘login’:
22 data = execute_cmd(cmd)
23
24 if data:
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 53

51 is_whitelisted(method)
52
53 return frappe.call(method, **frappe.form_dict)
54
55
/home/frappe/frappe-bench/apps/frappe/frappe/init.py: 942

940 del newargs[“flags”]
941
942 return fn(*args, **newargs)
943
944 def make_property_setter(args, ignore_validate=False, validate_fields_for_doctype=True):
/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py: 15

13 “”“Returns contacts (from autosuggest)”“”
14
15 cached_contacts = get_cached_contacts(txt)
16 if cached_contacts:
17 return cached_contacts[:page_length]
/home/frappe/frappe-bench/apps/frappe/frappe/email/init.py: 92

90 return contacts
91
92 match = [d for d in contacts if (txt in d.value or txt in d.description)]
93 return match
94

Deleted all my contacts . Nothing . I believe if I delete erpnext there won’t be any problem

Ok. Something with the import of csv and greek characters. I have to insert 530 contacts and I am doneeeeeeeeeee.