Error while setting up gmail account

I am trying to setup gmail account.

I have setup Domain then trying to create email account but is gave me below error

Cannot connect: b’[ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)’

Traceback (most recent call last):
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 166, in get_incoming_server
    email_server.connect()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/receive.py", line 43, in connect
    return self.connect_imap()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/receive.py", line 54, in connect_imap
    self.imap.login(self.settings.username, self.settings.password)
  File "/usr/lib/python3.6/imaplib.py", line 598, in login
    raise self.error(dat[-1])
imaplib.IMAP4.error: b'[ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in save
    return self._save(*args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
    self.run_before_save_methods()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
    self.run_method("validate")
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 68, in validate
    self.get_incoming_server()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 168, in get_incoming_server
    message = e.message.lower().replace(" ","")
AttributeError: 'error' object has no attribute 'message'

Traceback (most recent call last):
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 166, in get_incoming_server
    email_server.connect()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/receive.py", line 43, in connect
    return self.connect_imap()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/receive.py", line 54, in connect_imap
    self.imap.login(self.settings.username, self.settings.password)
  File "/usr/lib/python3.6/imaplib.py", line 598, in login
    raise self.error(dat[-1])
imaplib.IMAP4.error: b'[ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 1036, in call
    return fn(*args, **newargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in save
    return self._save(*args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
    self.run_before_save_methods()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
    self.run_method("validate")
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 68, in validate
    self.get_incoming_server()
  File "/home/sjain/erpnext/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 168, in get_incoming_server
    message = e.message.lower().replace(" ","")
AttributeError: 'error' object has no attribute 'message'

Kindly help me to solve this issue

1 Like

Solved this issue , i just upgrade my python

sudo apt upgrade python3

and restart using bench

bench restart