How to correctly 'reset' Gmail OAuth2 records?

Moderator: crythias

Post Reply
apathy
Znuny newbie
Posts: 6
Joined: 16 Feb 2023, 15:56
Znuny Version: 6.4.4
Real Name: Aleksej

How to correctly 'reset' Gmail OAuth2 records?

Post by apathy »

Hello!

We have 4 GMail OAuth2 token records in Znuny. Everything worked fine for about a week.

Today I've found 3 of 4 are broken. The record with ID 3 is fine.
Last token request failed. Last (refresh) token request failed.
Here's what happened in the log in chronological order:

First: for ID 4

Code: Select all

[Tue Mar 14 19:00:22 2023][Error][Kernel::System::WebUserAgent::Request][246] Can't perform POST on https://oauth2.googleapis.com/token: 503 Service Unavailable
[Tue Mar 14 19:00:22 2023][Error][Kernel::System::OAuth2Token::RequestTokenByRefreshToken][963] Response for request for token config with ID 4 and request type 'TokenByRefre
shToken' was not '200 OK'. internal_failure
[Tue Mar 14 19:00:22 2023][Error][Kernel::System::OAuth2Token::GetToken][1187] Error requesting token by refresh token for token config with ID 4.
[Tue Mar 14 19:00:22 2023][Error][Kernel::System::CommunicationLog::_LogError][535] CommunicationLog(ID:11424,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:36982)::Kernel::System::MailAccount::POP3S => OAuth2 token could not be retrieved.
And nothing more with mentioning ID 4. POP3 account linked to it fetches emails fine. Even though it shows failed token requests in the Znuny Interface.

Second, for ID 1

Code: Select all

[Wed Mar 15 20:50:12 2023][Error][Kernel::System::WebUserAgent::Request][246] Can't perform POST on https://oauth2.googleapis.com/token: 400 Bad Request
[Wed Mar 15 20:50:12 2023][Error][Kernel::System::OAuth2Token::RequestTokenByRefreshToken][963] Response for request for token config with ID 1 and request type 'TokenByRefreshToken' was not '200 OK'. invalid_grant: Token has been expired or revoked.
[Wed Mar 15 20:50:12 2023][Error][Kernel::System::OAuth2Token::GetToken][1187] Error requesting token by refresh token for token config with ID 1.
[Wed Mar 15 20:50:12 2023][Error][Kernel::System::CommunicationLog::_LogError][535] CommunicationLog(ID:13590,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:43798)::Kernel::System::MailAccount::POP3S => OAuth2 token could not be retrieved.
Now it spams the same every 10 minutes. Mail does not fetch.

Third, for ID 2

Code: Select all

[Thu Mar 16 08:30:07 2023][Error][Kernel::System::WebUserAgent::Request][246] Can't perform POST on https://oauth2.googleapis.com/token: 400 Bad Request
[Thu Mar 16 08:30:07 2023][Error][Kernel::System::OAuth2Token::RequestTokenByRefreshToken][963] Response for request for token config with ID 2 and request type 'TokenByRefreshToken' was not '200 OK'. invalid_grant: Token has been expired or revoked.
[Thu Mar 16 08:30:07 2023][Error][Kernel::System::OAuth2Token::GetToken][1187] Error requesting token by refresh token for token config with ID 2.
[Thu Mar 16 08:30:07 2023][Error][Kernel::System::CommunicationLog::_LogError][535] CommunicationLog(ID:14571,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:46878)::Kernel::System::MailAccount::POP3S => OAuth2 token could not be retrieved.
Spams the same every 10 minutes. Mail does not fetch.

How do I fix all of this correctly?

Thank you!
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: How to correctly 'reset' Gmail OAuth2 records?

Post by root »

Hi,

What is the mode of the consent screen, and what is the publishing status?
Maybe this link helps: https://support.google.com/cloud/answer ... %2Ctesting

-Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
apathy
Znuny newbie
Posts: 6
Joined: 16 Feb 2023, 15:56
Znuny Version: 6.4.4
Real Name: Aleksej

Re: How to correctly 'reset' Gmail OAuth2 records?

Post by apathy »

The publishing status is testing, with external users.

I don't know what is the mode of the consent screen.
Post Reply