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/error.py”, line 36, in make_error_snapshot
snapshot = get_snapshot(exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/error.py”, 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/error.py:
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/receive.py”, line 76, in connect_pop
self.pop.pass_(self.settings.password)
File “/usr/lib/python3.6/poplib.py”, line 213, in pass_
return self._shortcmd(‘PASS %s’ % pswd)
File “/usr/lib/python3.6/poplib.py”, line 176, in _shortcmd
return self._getresp()
File “/usr/lib/python3.6/poplib.py”, 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/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 271, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 886, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1056, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1039, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, 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/email_account.py”, line 68, in validate
self.get_incoming_server()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 167, in get_incoming_server
email_server.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 45, in connect
return self.connect_pop()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 90, in connect_pop
if self.is_temporary_system_problem(e):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, 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