GAM-team / GAM

command line management for Google Workspace
https://github.com/GAM-team/GAM/wiki
Apache License 2.0
3.5k stars 470 forks source link

[127556] Failed to execute script '__main__' due to unhandled exception! #1588

Closed TS-02 closed 1 year ago

TS-02 commented 1 year ago

The issue tracker is for reporting product deficiencies. "How do I?" questions should be posted to the discussion forum at https://groups.google.com/group/google-apps-manager. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

Full steps to reproduce the issue:

  1. Opened command prompt.
  2. Entered the following GAM command - 'gam create guardianinvite '
  3. Received the following error message -

Expected outcome (what are you trying to do?): Send Google Classroom invite to guardians email address.

Actual outcome (what errors or bad behavior do you see instead?):

Traceback (most recent call last): File "gam__main.py", line 50, in File "gam__main.py", line 45, in main File "gam\init.py", line 11356, in ProcessGAMCommand File "gam\init.py", line 2153, in doInviteGuardian File "gam\init.py", line 997, in buildGAPIObject File "gam\init__.py", line 925, in getValidOauth2TxtCredentials File "gam\auth\oauth.py", line 467, in refresh File "gam\auth\oauth.py", line 475, in _locked_refresh File "google\oauth2\credentials.py", line 228, in refresh File "google\oauth2\reauth.py", line 338, in refresh_grant File "google\oauth2_client.py", line 60, in _handle_error_response google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'}) [127556] Failed to execute script 'main__' due to unhandled exception!

taers232c commented 1 year ago

Try: gam oauth delete gam oauth create

Ross


Ross Scroggs @.***

On Dec 19, 2022, at 1:20 AM, Tamoor @.***> wrote:

The issue tracker is for reporting product deficiencies. "How do I?" questions should be posted to the discussion forum at https://groups.google.com/group/google-apps-manager https://groups.google.com/group/google-apps-manager. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

I have upgraded to the latest GAM release from https://github.com/GAM-team/GAM/releases https://github.com/GAM-team/GAM/releases and I still have this issue. I am typing the command as described in the GAM Wiki at https://github.com/jay0lee/gam/wiki https://github.com/jay0lee/gam/wiki - Yes Full steps to reproduce the issue:

Opened command prompt. Entered the following GAM command - 'gam create guardianinvite ' Received the following error message - Expected outcome (what are you trying to do?): Send Google Classroom invite to guardians email address.

Actual outcome (what errors or bad behavior do you see instead?):

Traceback (most recent call last): File "gammain.py", line 50, in File "gammain.py", line 45, in main File "gaminit.py", line 11356, in ProcessGAMCommand File "gaminit.py", line 2153, in doInviteGuardian File "gaminit.py", line 997, in buildGAPIObject File "gaminit.py", line 925, in getValidOauth2TxtCredentials File "gam\auth\oauth.py", line 467, in refresh File "gam\auth\oauth.py", line 475, in _locked_refresh File "google\oauth2\credentials.py", line 228, in refresh File "google\oauth2\reauth.py", line 338, in refresh_grant File "google\oauth2_client.py", line 60, in _handle_error_response google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'}) [127556] Failed to execute script 'main' due to unhandled exception!

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLYLV63JEUFBJ3MPCNDWOASHNANCNFSM6AAAAAATDEFSOE. You are receiving this because you are subscribed to this thread.

TS-02 commented 1 year ago

Hi @taers232c,

Thank you for your reply.

I didn't ordinally set up GAM, but could you confirm what the above commands do.

If I do run both commands, would I need to set everything up again as mentioned below?

GAM Authorisation

Kind Regards,

Tamoor

taers232c commented 1 year ago

Tamoor,

You client credentials stored in oauth2.txt are no longer valid. This command deletes those credentials: gam oauth delete This command creates new credentials: gam oauth create

The second command is doing what is described in your screenshot.

Ross

Ross Scroggs @.***

On Dec 20, 2022, at 1:17 AM, Tamoor @.***> wrote:

Hi @taers232c https://github.com/taers232c,

Thank you for your reply.

I didn't ordinally set up GAM, but could you confirm what the above commands do.

If I do run both commands, would I need to set everything up again as mentioned below?

https://user-images.githubusercontent.com/52854743/208629639-316324f0-6793-4886-90c2-ef55d747b211.png Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1359055170, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL3LKM5Y7DGBXY4PLMTWOF2STANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

TS-02 commented 1 year ago

Hi Ross,

Thank you for confirming that for me.

By doing this, would I need to do anything else?

And, just to confirm, how often would the credentials expire? Is this a monthly/yearly thing?

Kind Regards,

Tamoor

taers232c commented 1 year ago

Tamoor,

That should be enough.

It's not a monthly/yearly thing, changing the super admin password forces them to expire.

Ross

Ross Scroggs @.***

On Dec 20, 2022, at 7:09 AM, Tamoor @.***> wrote:

Hi Ross,

Thank you for confirming that for me.

By doing this, would I need to do anything else?

And, just to confirm, how often would the credentials expire? Is this a monthly/yearly thing?

Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1359537962, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL5CCWLRM5ZE4A5OGY3WOHD4BANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

TS-02 commented 1 year ago

Hi Ross,

Thanks for confirming. Our admin password for Google Workspace hasn't changed recently so I'm not sure what caused this to occur.

I will try those two commands and provide an update shortly.

Kind Regards,

Tamoor

TS-02 commented 1 year ago

Hi @taers232c,

I entered the commands that you provided and continued to the authorization step.

When I went to the verification link I received the following error message on the web page.

image

Am I missing something?

Kind Regards,

Tamoor

taers232c commented 1 year ago

Tamoor,

I'm in California (PST), what is your time zone? I'd like to arrange a Meet/Zoom session.

Ross

Ross Scroggs @.***

On Jan 3, 2023, at 4:04 AM, Tamoor @.***> wrote:

Hi @taers232c https://github.com/taers232c,

I entered the commands that you provided and continued to the authorization step.

When I went to the verification link I received the following error message on the web page.

https://user-images.githubusercontent.com/52854743/210353827-9203b11b-1e4f-43f7-8ffa-4b76f536e98f.png Am I missing something?

Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1369692381, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLYEELJB7WYELBVB7DLWQQIVXANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

TS-02 commented 1 year ago

Hi Ross,

I'm based in the UK so there's an 8 hour time gap.

Would you be available anytime between 11AM - 1PM PST?

Kind Regards,

Tamoor

taers232c commented 1 year ago

Tamoor,

Yes

Ross

Ross Scroggs @.***

On Jan 3, 2023, at 12:55 PM, Tamoor @.***> wrote:

Hi Ross,

I'm based in the UK so there's an 8 hour time gap.

Would you be available anytime between 11AM - 1PM PST?

Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1370215155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL5XHBDOSUCMIAXPS6LWQSG3BANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

taers232c commented 1 year ago

Tamoor,

I'm going to be unavailable until 11:30.

Ross

Ross Scroggs @.***

On Jan 3, 2023, at 12:55 PM, Tamoor @.***> wrote:

Hi Ross,

I'm based in the UK so there's an 8 hour time gap.

Would you be available anytime between 11AM - 1PM PST?

Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1370215155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL5XHBDOSUCMIAXPS6LWQSG3BANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

TS-02 commented 1 year ago

Hi Ross,

Thank you for your update. I will need to double check something with my colleague regarding the account used.

If that's okay with yourself, I will provide an update as soon as possible.

Kind Regards,

Tamoor

taers232c commented 1 year ago

OK

Ross Scroggs @.***

On Jan 4, 2023, at 11:59 AM, Tamoor @.***> wrote:

Hi Ross,

Thank you for your update. I will need to double check something with my colleague regarding the account used.

If that's okay with yourself, I will provide an update as soon as possible.

Kind Regards,

Tamoor

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1588#issuecomment-1371358602, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL5STYMYGJ7ZZBE6EZLWQXJDFANCNFSM6AAAAAATDEFSOE. You are receiving this because you were mentioned.

TS-02 commented 1 year ago

Hi Ross,

I hope you've been well.

Just a quick update. I found that re-installing GAM itself resolved this issue.

It seemed the current version I was on caused an issue when attempting to re-authenticate with our admin email address.

Thank you for the assistance though.