Can someone help fix this gmail password validation error?

I’m having this error every few hours. I only setup my email account for outgoing and using smtp.gmail.com as server.

frappe.email.queue.flush

(534, ‘5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbtN\n5.7.14 Rx3ll-1asUxyGwWYU-ofCTy4urpi12bDg943O3_xxfkhbFYiYM4FO6Ai6iiUYUJ39TTIyT\n5.7.14 t8-asUxuy07La2w2fIrwWO36DmRIexHvAs6vRw1Hn9jkrXMZmDD9nABnDcAd88W3UNEZxN\n5.7.14 YuTjd3IziuJnb7u8zFd-Nr37EN8UuBG-QulGX6lZvj1ehfr3v3JMH4C3KULXSoM1cClBee\n5.7.14 KPSCUvIlPWcTvkpYWT3zSwlusENhqhRnkQuvBRar0-tcN7ughSsnCd3yx0QhRv8hTYXReM\n5.7.14 r_8MIcR4O-Mzr6W-dg7yPeWt2zE4zcHg2ceXKxqPH8IY-v963Z_G5N52_V7ZHBD1vpLVc-\n5.7.14 tU4o_pJvfXfExTinDCAtBym_HqAwrY8XDlggftI8I6OpTwPippdRv1RJ7OD8Up2lWu3lvf\n5.7.14 SmFRYbB-al_G_SQ9KeVbJyfD62zLFM9EaQjrKuUkJ84DBYG5jevdCekQzQ0UQH7HenoL3J\n5.7.14 lxPKQ> Please log in via your web browser and then try again.\n5.7.14 Learn more at\n5.7.14 Can't sign in to your Google Account - Gmail Help i7-v6sm8151248pgs.17 - gsmtp’)
Traceback (most recent call last):
File “/home/administrator/frappe-bench/apps/frappe/frappe/email/queue.py”, line 417, in send_one
smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
File “/home/administrator/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 229, in sess
raise_(frappe.ValidationError, e, traceback)
File “/home/administrator/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 211, in sess
(self.password or “”).encode(‘utf-8’))
File “/usr/lib/python2.7/smtplib.py”, line 622, in login
raise SMTPAuthenticationError(code, resp)
ValidationError: (534, ‘5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbtN\n5.7.14 Rx3ll-1asUxyGwWYU-ofCTy4urpi12bDg943O3_xxfkhbFYiYM4FO6Ai6iiUYUJ39TTIyT\n5.7.14 t8-asUxuy07La2w2fIrwWO36DmRIexHvAs6vRw1Hn9jkrXMZmDD9nABnDcAd88W3UNEZxN\n5.7.14 YuTjd3IziuJnb7u8zFd-Nr37EN8UuBG-QulGX6lZvj1ehfr3v3JMH4C3KULXSoM1cClBee\n5.7.14 KPSCUvIlPWcTvkpYWT3zSwlusENhqhRnkQuvBRar0-tcN7ughSsnCd3yx0QhRv8hTYXReM\n5.7.14 r_8MIcR4O-Mzr6W-dg7yPeWt2zE4zcHg2ceXKxqPH8IY-v963Z_G5N52_V7ZHBD1vpLVc-\n5.7.14 tU4o_pJvfXfExTinDCAtBym_HqAwrY8XDlggftI8I6OpTwPippdRv1RJ7OD8Up2lWu3lvf\n5.7.14 SmFRYbB-al_G_SQ9KeVbJyfD62zLFM9EaQjrKuUkJ84DBYG5jevdCekQzQ0UQH7HenoL3J\n5.7.14 lxPKQ> Please log in via your web browser and then try again.\n5.7.14 Learn more at\n5.7.14 Can't sign in to your Google Account - Gmail Help i7-v6sm8151248pgs.17 - gsmtp’)

You will need to allow access to “lesssecureapps”.
More information: https://myaccount.google.com/lesssecureapps

However if you have 2 factor authentication enabled, you won’t be able to login via this.
Ref: smtplib - SMTPAuthenticationError when sending mail using gmail and python - Stack Overflow

I already allowed less secure apps. not using 2 factor authentication.

Try to update ERPNext

$ bench update

It may solve the issue.

1 Like

@airzoink Then please cross check your password, because it is clearly showing a validation error.

I retyped my email password and checked awaiting password. I will observe for errors. Thanks for the suggestions.

@codingCoffee
Still getting errors. If i unchecked awaiting password and click save it says invalid pogin and password. I’m running v10.1.52 (master).

Have you tried generating an App password as instructed here

Just copy and paste replace your current one with the one provided by Google!

That may be required for less secure apps and worked for me I seem to recall.

Does your password have any special characters? For some reason this was an issue for us, removing them allowed it to authenticate fine.

I reconfigured my less secure apps in google accounts and so far not getting any errors anymore. Further checking tomorrow if emails got sent. Thanks for all the help and suggestions. :grinning:

Please can you be specific - that would help so all will learn from you here!

Log in to your Gmail account through a web browser and enable access through less secure apps . Less secure apps can make your account more vulnerable, Google will automatically turn this setting off if it’s not being used. However, bypass this security setting with a configuration tweak within your Google Email Account .

How “more secure apps” help to protect your account?

  • Which level of access you’re giving the client before you connect your Account.
  • Client access only a relevant part of your Account, like your email or calendar.
  • Connect your Google Account to the client without exposing your password.
  • Disconnect your Google Account from the client at any time.
1 Like

I have exactly the same problem as you solved it, could you help me, thanks.