Unable to register gmail account: app password needed but hidden from user
Bug Summary
Whenever I try adding a new account based on gmail, I get the following error in a popup:
Account not created: Could not connect, check your network
Your installation
- Geary version:
3.32.2
- Installation method: RPM package from default Fedora 30 repos
- Desktop environment: XFCE
- Operating system and version: Fedora 30 x86_64
- Email provider: Gmail
Steps to reproduce
- Options button > Accounts
- Add an account > Gmail
- Insert username and password > Create
What happened?
The following error is reported in a popup: Account not created: Could not connect, check your network
This is a different error message from e.g. when a wrong password is used, where the popup error is: Account not created: Check your email address and password
Relevant logs and/or screenshots
Running from terminal with debug option shows the following (only relevant info about account creation):
$ geary -d
...
[deb] 22:30:05 25.569505 geary: imap-client-session.vala:1741: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_CONNECTING] Connected to imap.gmail.com:993
[deb] 22:30:05 0.000011 geary: imap-client-session.vala:787: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_CONNECTING] Connected
[deb] 22:30:05 0.031815 geary: imap-client-session.vala:1816: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_NOAUTH] capability #1: NAMESPACE IMAP4rev1 X-GM-EXT-1 XYZZY "AUTH=OAUTHBEARER" "AUTH=PLAIN" "AUTH=XOAUTH" "AUTH=PLAIN-CLIENTTOKEN" "AUTH=XOAUTH2" UNSELECT SASL-IR CHILDREN XLIST QUOTA ID IDLE
[deb] 22:30:06 0.268209 geary: imap-client-session.vala:1103: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_AUTHORIZING] Unable to LOGIN: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure)
[deb] 22:30:06 0.001068 geary: imap-deserializer.vala:255: [des:0003/GEARY_IMAP_DESERIALIZER_STATE_CLOSED] Deserializer closed
[deb] 22:30:06 0.000397 geary: imap-client-connection.vala:272: [0003/imap.gmail.com:993/Disconnected] Disconnecting...
[deb] 22:30:06 0.000209 geary: imap-client-connection.vala:275: [0003/imap.gmail.com:993/Disconnected] Disconnected
[deb] 22:30:06 0.000023 geary: imap-client-session.vala:1747: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_BROKEN] Disconnected from imap.gmail.com:993
[deb] 22:30:06 0.088734 geary: accounts-editor-add-pane.vala:269: Error validating SMTP service: GearyImapError 4: "Login error: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure): "
[deb] 22:30:06 0.003014 geary: imap-client-session.vala:497: DTOR: ClientSession imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_BROKEN
[deb] 22:30:14 8.373964 geary: util-connectivity-manager.vala:109: Checking if outlook.office365.com:993 reachable...
[deb] 22:30:14 0.000165 geary: util-connectivity-manager.vala:109: Checking if smtp.office365.com:587 reachable...
[deb] 22:30:26 12.024434 geary: imap-client-session.vala:1741: [0004/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_CONNECTING] Connected to imap.gmail.com:993
[deb] 22:30:26 0.000012 geary: imap-client-session.vala:787: [0004/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_CONNECTING] Connected
[deb] 22:30:26 0.031458 geary: imap-client-session.vala:1816: [0004/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_NOAUTH] capability #1: NAMESPACE IMAP4rev1 X-GM-EXT-1 XYZZY "AUTH=OAUTHBEARER" "AUTH=PLAIN" "AUTH=XOAUTH" "AUTH=PLAIN-CLIENTTOKEN" "AUTH=XOAUTH2" UNSELECT SASL-IR CHILDREN XLIST QUOTA ID IDLE
[deb] 22:30:27 0.899709 geary: imap-client-session.vala:1103: [0004/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_AUTHORIZING] Unable to LOGIN: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure)
[deb] 22:30:27 0.000767 geary: imap-deserializer.vala:255: [des:0004/GEARY_IMAP_DESERIALIZER_STATE_CLOSED] Deserializer closed
[deb] 22:30:27 0.000286 geary: imap-client-connection.vala:272: [0004/imap.gmail.com:993/Disconnected] Disconnecting...
[deb] 22:30:27 0.000150 geary: imap-client-connection.vala:275: [0004/imap.gmail.com:993/Disconnected] Disconnected
[deb] 22:30:27 0.000016 geary: imap-client-session.vala:1747: [0004/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_BROKEN] Disconnected from imap.gmail.com:993
[deb] 22:30:27 0.069238 geary: accounts-editor-add-pane.vala:269: Error validating SMTP service: GearyImapError 4: "Login error: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure): "
[deb] 22:30:27 0.003471 geary: imap-client-session.vala:497: DTOR: ClientSession imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_BROKEN
...
Notice the several references to the App password:
[deb] 22:30:06 0.088734 geary: accounts-editor-add-pane.vala:269: Error validating SMTP service: GearyImapError 4: "Login error: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure): "
[deb] 22:30:06 0.268209 geary: imap-client-session.vala:1103: [0003/imap.gmail.com:993 GEARY_IMAP_CLIENT_SESSION_STATE_AUTHORIZING] Unable to LOGIN: a002 NO [ALERT] Application-specific password required: https://support.google.com/accounts/answer/185833 (Failure)
How to solve
Follow the link provided by Gmail and setup an App password: https://support.google.com/accounts/answer/185833
What did you expect to happen?
Connect to Gmail, or at least report the error message so that the user can connect.
Probably this was caused by recent OAuth changes by Google the last month, but it's just a supposition.
https://bugzilla.mozilla.org/show_bug.cgi?id=1592407#c22
Don't know whether this qualify as a bug though.