Unhandled Exception

148 views
Skip to first unread message

Kyle Vitale

unread,
Jul 18, 2022, 2:35:14 PM7/18/22
to GAM for Google Workspace
Hi all, 

I am fairly new to GAM and have run into some trouble when trying to access calendars. When I run gam calendar [anyuser]@[mydomain].org showacl I get the following Traceback error:

Traceback (most recent call last):
  File "gam/__main__.py", line 49, in <module>
  File "gam/__main__.py", line 44, in main
  File "gam/__init__.py", line 11834, in ProcessGAMCommand
  File "gam/gapi/calendar.py", line 45, in printShowACLs
  File "gam/gapi/calendar.py", line 31, in buildCalendarDataGAPIObject
  File "gam/gapi/calendar.py", line 20, in normalizeCalendarId
  File "gam/__init__.py", line 8745, in _getValueFromOAuth
  File "gam/auth/oauth.py", line 420, in get_token_value
  File "gam/auth/oauth.py", line 402, in _fetch_id_token_data
  File "gam/auth/oauth.py", line 474, in refresh
  File "gam/auth/oauth.py", line 482, in _locked_refresh
  File "google/oauth2/credentials.py", line 302, in refresh
  File "google/oauth2/reauth.py", line 347, in refresh_grant
  File "google/oauth2/_client.py", line 62, in _handle_error_response
google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})
[70212] Failed to execute script '__main__' due to unhandled exception!

However, I am able to add/remove email delegates without issue (which is my main use for GAM). Any ideas ?

Thanks!
Kyle

Jay Lee

unread,
Jul 18, 2022, 2:41:59 PM7/18/22
to google-ap...@googlegroups.com
What does:

gam user <user> check serviceaccount

Show? Follow any steps it suggests.

Jay

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/873d430e-04a8-4052-ae07-174004ae5887n%40googlegroups.com.

Kyle Vitale

unread,
Jul 18, 2022, 2:46:33 PM7/18/22
to google-ap...@googlegroups.com
Everything passed except my key was old. It recommended running gam rotate sakey, which I did. All checks show passed now, but the calendar command still doesn't work:

Computer clock status:
 Your system time differs from admin.googleapis.com by less than 1 second   PASS
Service Account Private Key Authentication:
 Authenticating...                                                          PASS
Checking key age. Google recommends rotating keys on a routine basis...
 Key is -1 days old                                                         PASS
Domain-Wide Delegation authentication as kvi...@ma.org:
 https://mail.google.com/                                                   PASS
 https://www.googleapis.com/auth/apps.alerts                                PASS
 https://www.googleapis.com/auth/calendar                                   PASS
 https://www.googleapis.com/auth/cloud-identity                             PASS
 https://www.googleapis.com/auth/drive                                      PASS
 https://www.googleapis.com/auth/drive.activity                             PASS
 https://www.googleapis.com/auth/gmail.settings.basic                       PASS
 https://www.googleapis.com/auth/gmail.settings.sharing                     PASS
 https://www.googleapis.com/auth/spreadsheets                               PASS



--


Kyle Vitale

Director of Technology

415-482-3261

1600 Mission Ave.
San Rafael, CA, 94901

Jay Lee

unread,
Jul 18, 2022, 2:48:58 PM7/18/22
to google-ap...@googlegroups.com
Are you sure Google Calendar service is enabled for that user? Try confirming in the Admin console.

Jay

Kyle Vitale

unread,
Jul 18, 2022, 2:51:43 PM7/18/22
to google-ap...@googlegroups.com
Yes, Google Calendar is enabled domain-wide. And that user is my, I'm the Google Admin, and I use Google Calendar everyday!

Jay Lee

unread,
Jul 18, 2022, 2:57:44 PM7/18/22
to google-ap...@googlegroups.com
Is the address you are specifying the user's primary email address? Don't use an alias, use the primary and be sure you are entering the address exactly as it is in the admin console.

Jay

Jay Lee

unread,
Jul 18, 2022, 3:01:53 PM7/18/22
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages