New errors in email settings

After one of the latest bench updates, I’ve suddenly lost email connectivity. I went to the email account settings and was going to test another account but found I couldn’t save it. When I hit save, I get:

Server Error
AttributeError: ‘error_proto’ object has no attribute ‘message’

So, I just reloaded the page to abandon my changes and tried to save with the same values that were previously working and I get the same error.

If I go to Email Domain and open my domain, hit save with no changes… I get this:

Server Error
TypeError: Object of type ‘AttributeError’ is not JSON serializable

This was a previously working setup and as far as I know, nothing other than bench update has altered the system.

If I make a new account and accept all defaults, it will save. However, if I check Enable Incoming, then the attribute error appears.

Ok, we figured it out. Our domain transitioned to two-layer authentication which broke the email connection because it couldn’t authenticate. It’s too bad the error messages didn’t have more meaningful clues!

Have you server side access to the logs to post the complete traceback?

The only log info I could find that seemed to be related was in node-socketio.log:

{ Error: unable to verify the first certificate
at TLSSocket. (_tls_wrap.js:1116:38)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:643:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) code: ‘UNABLE_TO_VERIFY_LEAF_SIGNATURE’, response: undefined }

Anyway, I have it working again but I’ll need to figure out if two-factor authentication is going to be feasible.

Update - not sure how I missed it but here’s the complete traceback:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 36, in make_error_snapshot
snapshot = get_snapshot(exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 131, in get_snapshot
if type(value)==str and value.startswith(b"u’"):
TypeError: startswith first arg must be str or a tuple of str, not bytes
[ERROR] 2019-09-13 10:54:50,970 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/
Could not take error snapshot: startswith first arg must be str or a tuple of str, not bytes
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 76, in connect_pop
File “/usr/lib/python3.6/”, line 213, in pass_
return self._shortcmd(‘PASS %s’ % pswd)
File “/usr/lib/python3.6/”, line 176, in _shortcmd
return self._getresp()
File “/usr/lib/python3.6/”, line 152, in _getresp
raise error_proto(resp)
poplib.error_proto: b’-ERR Logon failure: unknown user name or bad password.’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 56, in execute_cmd
return, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/”, line 22, in savedocs
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 271, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 307, in _save
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 886, in run_before_save_methods
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1056, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1039, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/”, line 68, in validate
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/”, line 167, in get_incoming_server
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 45, in connect
return self.connect_pop()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 90, in connect_pop
if self.is_temporary_system_problem(e):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 301, in is_temporary_system_problem
if message in strip(cstr(e.message)) or message in strip(cstr(getattr(e, ‘strerror’, ‘’))):
AttributeError: ‘error_proto’ object has no attribute ‘message’

1 Like