GMail - Authentication failed, invalid credentials! (Exceptions::UnprocessableEntity)

Infos:

  • Used Zammad version: 3.6.0 (updated today)
  • Used Zammad installation source: Deb10 Package
  • Operating system: Deb10
  • Browser + version: Chrome

Expected behavior:

Inbound emails from Gmail should be fetched and processed.

Actual behavior:

Inbound of emails are no longer been fetched from gmail. It might be related to their outage yesterday. Deleting the account or to re-auth an existing end with this log message
"Authentication failed, invalid credentials! (Exceptions::UnprocessableEntity)

Steps to reproduce the behavior:

Unsure, for us this occurs now on all inboxes hosted with G Suite.

I, [2020-12-15T16:17:16.687140 #622-47078685221240] INFO – : Processing by ChannelsGoogleController#inbound as JSON
I, [2020-12-15T16:17:16.687331 #622-47078685221240] INFO – : Parameters: {“options”=>{“folder”=>"", “keep_on_server”=>false}, “active”=>true, “id”=>“7”}
I, [2020-12-15T16:17:16.709989 #622-47078685221240] INFO – : fetching imap (imap.gmail.com/REDACTEDADDRESS@TLD.com port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=XOAUTH2)
E, [2020-12-15T16:17:17.816461 #622-47078685221240] ERROR – : Authentication failed, invalid credentials! (Exceptions::UnprocessableEntity)
/opt/zammad/app/controllers/channels_google_controller.rb:77:in `inbound’

You so I understand this correctly, you also receive an error message when you’re trying to delete an account in Zammad?

Hi benmo,

not quite, the account cannot fetch any more emails from gmail. We tried to delete it and recreate, re-auth. In all cases, this appears

Have you tried removing and re-adding the Google app? You might also want to remove the permissions for the app in your Google account so you have to give your consent again when adding the app.

thank you benmo, I have done so and removed the granted privileges from the Gmail account (enabled iMap, allowed less secure apps, deleted the whole account in Zammad, reAuth the account (which used to work for month just fine). Still the same issue.

the hint of checking the app lead me to review the OAuth app.
General nothing wrong with it, but since the day it stopped working I have an API error on

caribou.api.proto.MailboxService.ListSendAs

Weird. I’d suggest you try to delete and recreate the app in Google. You could also try to verify the functionality of the app with the OAuth playground: https://developers.google.com/oauthplayground/

I took a new project and set a new OAuth app to internal, did the setup and granted Gmail API rights.
Same issue and same API error on the new OAauth/API Metrics

I checked the playground and took the closest API which was available

https://gmail.googleapis.com/gmail/v1/users/me/settings/sendAs

and I can ready the correct values for this account.

Sorry, but you’re being striked by a bug:

Sketchy Workaround

You can workaround this by closing the dialogue in question and update the channel in question to “active”. Wait about 30-60 seconds until the state color of the channel changes from yellowish to greenish, hit “EDIT” and change the settings if you want to.

However, this comes with a price
Zammad by default removes all mails from your mail server. This means that above workaround removes mails from your inbox. If you don’t want that, you should not use this work around.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.