Error running all commands

133 views
Skip to first unread message

Norman Chin

unread,
Sep 19, 2019, 3:54:05 PM9/19/19
to GAM for G Suite
Today I am getting the following error for all commands I am running with gam 4.94 (except gam info). Example below:

C:\GAM>gam info domain
Traceback (most recent call last):
  File "gam.py", line 14898, in <module>
  File "gam.py", line 14296, in ProcessGAMCommand
  File "gam.py", line 2149, in doGetDomainInfo
  File "gam.py", line 2171, in doGetCustomerInfo
  File "gam.py", line 1362, in buildGAPIObject
  File "gam.py", line 1290, in getValidOauth2TxtCredentials
  File "gam.py", line 1279, in getOauth2TxtStorageCredentials
  File "json\__init__.py", line 348, in loads
  File "json\decoder.py", line 340, in decode
json.decoder.JSONDecodeError: Extra data: line 21 column 2 (char 1863)
[11212] Failed to execute script gam

Any ideas on how to fix this. It was working earlier today but now this is the error I get for all commands.

Thanks in advance.

Admin Danny Dillon - NOAA Service Account

unread,
Sep 19, 2019, 4:06:54 PM9/19/19
to GAM for G Suite
I have been running into this almost nightly with both 4.94 and 4.87
oauth2.txt is corrupted.
If you delete the file, the next gam command will redo your scopes/auth and it will work until lit breaks again.

Ross Scroggs

unread,
Sep 19, 2019, 4:09:08 PM9/19/19
to google-ap...@googlegroups.com
Danny,

You can also force a rebuild with:
gam oauth delete
gam oauth create

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/0bfbd33b-f465-48f4-8eda-e30cfd95d5dc%40googlegroups.com.


--

Jay Lee

unread,
Sep 19, 2019, 4:13:53 PM9/19/19
to google-ap...@googlegroups.com
Yep, seems to be a bug here. Possibly with locking the file when writing to it. For now it'll require a rebuild as Ross describes. I'll try to poke at it soon and see if I can get a fix in.

Jay

Admin Danny Dillon - NOAA Service Account

unread,
Sep 19, 2019, 4:40:07 PM9/19/19
to GAM for G Suite
Far more elegant, thanks ;)
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.


--
Ross Scroggs

Norman Chin

unread,
Sep 19, 2019, 4:48:24 PM9/19/19
to GAM for G Suite
Thanks for the quick responses Ross and Jay and Danny. Sounds like a fix will be in the works. The delete and create should a good enough workaround for now.

Danny Dillon - NOAA Affiliate

unread,
Sep 24, 2019, 8:48:31 AM9/24/19
to google-ap...@googlegroups.com
For the record,  gam oauth delete does not work in this state either.  AFAIK, only gam version works.

/sync/gam_4.94]# ./gam oauth delete

Traceback (most recent call last):
  File "gam.py", line 14898, in <module>
  File "gam.py", line 14478, in ProcessGAMCommand
  File "gam.py", line 13357, in doDeleteOAuth

  File "gam.py", line 1279, in getOauth2TxtStorageCredentials
  File "json/__init__.py", line 348, in loads
  File "json/decoder.py", line 340, in decode
json.decoder.JSONDecodeError: Extra data: line 21 column 2 (char 1862)
[18935] Failed to execute script gam


Thanks,
Danny 






--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/f9e58355-3610-461e-b594-cf7155e2e9f4%40googlegroups.com.

Jay Lee

unread,
Sep 24, 2019, 8:58:57 AM9/24/19
to google-ap...@googlegroups.com
An easier option than redoing authentication would be to keep a backup copy of oauth2.txt and then copy over when it becomes corrupt.

Jay

Ross Scroggs

unread,
Sep 24, 2019, 9:01:47 AM9/24/19
to google-ap...@googlegroups.com
Danny,

Open oauth2.txt is an editor, the last lines should look like this:
  "token_expiry": "2019-09-24T13:45:55Z",
}

If there are additional characters at the end, delete them:
  "token_expiry": "2019-09-24T13:45:55Z",
}en"
}
In this case, delete:
en"
}

You can always delete oauth2.txt and then do a gam oauth create

Ross


Jay Lee

unread,
Sep 29, 2019, 8:23:32 PM9/29/19
to google-ap...@googlegroups.com
Could both of you respond on https://github.com/jay0lee/GAM/issues/1011 with the OS you are seeing this issue on? So far I haven't been able to reproduce the corruption which makes it hard to know what's going on.

Jay

Danny Dillon - NOAA Affiliate

unread,
Sep 29, 2019, 9:15:57 PM9/29/19
to google-ap...@googlegroups.com
Done. Here as well

I have experienced it multiple times on both of these, invariably on overnight reports.
I will add that gam oauth does not work on the corrupt copy - you have to manually delete, or restore a good copy.
 
GAM 4.87 - https://git.io/gam
Jay Lee jay...@gmail.com
Python 3.7.3 64-bit final
google-api-python-client 1.7.8
Linux-2.6.32-754.23.1.el6.x86_64-x86_64-with-redhat-6.10-Santiago x86_64
Path: /opt/sync/gam_4.87
OpenSSL 1.1.1c 28 May 2019
www.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384
 
GAM 4.94 - https://git.io/gam
Jay Lee jay...@gmail.com
Python 3.7.4 64-bit final
google-api-python-client 1.7.11
Linux-2.6.32-754.23.1.el6.x86_64-x86_64-with-redhat-6.10-Santiago x86_64
Path: /opt/sync/gam_4.94
Your computer is 0 seconds off from Google's time.
OpenSSL 1.1.1c 28 May 2019
www.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384


Thanks,
Danny








Reply all
Reply to author
Forward
0 new messages