Gam Access Expired?

314 views
Skip to first unread message

Nicodemus Brothers

unread,
Dec 3, 2021, 2:15:18 PM12/3/21
to GAM for Google Workspace
Hey all! 

I have been able to get by without GAM for a good while now, but a situation has occurred that prompted me to reach back into the toolbelt for GAM. I originally set up GAM to run in a cloud instance on GCP and it worked perfectly at the time. Now when I try anything, I get an error, and I am wondering if the key I generated (sorry I don't have all the terminology right) back then is expired or something. I will note that I am currently on GAM 5.03. 

I started to go back to the setup process but wasn't sure exactly what part needed to be fixed so I thought I would consult with people who are smarter than me to tell me where I should start. 

So when I launch GCP and type gam, it seems to get started ok. Once I'm in however, any command seems to get me the following output:

nbrothers@cs-492057367909-default-boost-jt7vt:~$ gam oauth info
Traceback (most recent call last):
  File "gam.py", line 11594, in <module>
  File "gam.py", line 11157, in ProcessGAMCommand
  File "gam.py", line 10037, in OAuthInfo
  File "gam.py", line 716, in getValidOauth2TxtCredentials
  File "auth/oauth.py", line 456, in refresh
  File "auth/oauth.py", line 464, in _locked_refresh
  File "site-packages/google/oauth2/credentials.py", line 176, in refresh
  File "site-packages/google/oauth2/_client.py", line 248, in refresh_grant
  File "site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request
  File "site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', '{\n  "error": "invalid_grant",\n  "error_description": "Bad Request"\n}')
[1078] Failed to execute script gam

Does anybody have any insight on what parts of the setup process I should undo/redo? I would appreciate any leads :) 

Thank you in advance! 

Ross Scroggs

unread,
Dec 3, 2021, 9:40:06 PM12/3/21
to google-ap...@googlegroups.com
Nicodemus,

You should update to the current version.
In GCP do: 
bash <(curl -s -S -L https://git.io/install-gam)
Can you run a full browser on this machine? (usually Y for MacOS, N for Linux if you SSH into this machine) N
GAM is now installed. Are you ready to set up a Google API project for GAM? (yes or no) no

Then do the following steps following directions if given.
cd ~/bin/gam
touch nobrowser.txt
gam update project
gam oauth delete
gam oauth create
gam user us...@domain.com check serviceaccount   (substitute actual email address for us...@domain.com)

Ross

--
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/f3c531ff-bc8d-4de9-b73b-256e9ffcf73cn%40googlegroups.com.

Nick Brothers

unread,
Dec 6, 2021, 10:46:49 AM12/6/21
to google-ap...@googlegroups.com
Ross, thank you so much! 

I followed your steps and it looks like I am back in business! You are a wizard!


From: google-ap...@googlegroups.com <google-ap...@googlegroups.com> on behalf of Ross Scroggs <ross.s...@gmail.com>
Sent: Friday, December 3, 2021 9:39 PM
To: google-ap...@googlegroups.com <google-ap...@googlegroups.com>
Subject: Re: [GAM] Gam Access Expired?
 
You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/tnsLtT9oXa4/unsubscribe.
To unsubscribe from this group and all its topics, 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/7716E8D5-D8EF-4E94-8C30-31522E11E05E%40gmail.com.
Reply all
Reply to author
Forward
0 new messages