GAM-team / GAM

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

Creating GAM Project - Unhandled Exception error (1312) due to UnboundLocalError #1615

Closed LiamWatson28 closed 1 year ago

LiamWatson28 commented 1 year ago

I am trying to install GAM on Google Cloud Shell. It would be the latest version (6.51) as I am using the command to download it. At the project creation stage, I get through the verification code part. It then enables the APIs and gets to the "Creating Service Account" part, after which I get this:

Creating Service Account Traceback (most recent call last): File "gam/main.py", line 49, in File "gam/main.py", line 44, in main File "gam/init.py", line 11645, in ProcessGAMCommand File "gam/init.py", line 7775, in doCreateProject File "gam/init.py", line 7412, in _createClientSecretsOauth2service File "gam/init.py", line 8036, in doCreateOrRotateServiceAccountKeys UnboundLocalError: cannot access local variable 'validity_hours' where it is not associated with a value [1312] Failed to execute script 'main' due to unhandled exception!

Full steps to reproduce the issue:

  1. Run bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install) to download GAM.
  2. Type "N" when prompted about running a full browser on the machine.
  3. Type "Y" to set up Google API project for GAM
  4. Follow link to get verification code and paste URL/code into terminal.
  5. Wait until creation fails.
taers232c commented 1 year ago

PR #1614 fixes this error.

johngoolsky commented 1 year ago

@taers232c I'm experiencing this issue as well. My apologies, as I'm just learning my way around GitHub - I see that the commit was merged and that 15/16 checks were passed - does that mean we're still waiting on the issue to be fixed?

taers232c commented 1 year ago

Jay has fixed the code it has not been released.

johngoolsky commented 1 year ago

@taers232c got it - thank you for the clarification!

jay0lee commented 1 year ago

It's building now...

https://github.com/GAM-team/GAM/actions/runs/4439412613

Jay Lee

On Thu, Mar 16, 2023 at 4:20 PM johngoolsky @.***> wrote:

@taers232c https://github.com/taers232c got it - thank you for the clarification!

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1615#issuecomment-1472682486, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDIZMHBP66W4LJHL3OINRDW4NYXFANCNFSM6AAAAAAV5LH424 . You are receiving this because you were assigned.Message ID: @.***>

johngoolsky commented 1 year ago

Very cool - thank you @jay0lee!

jay0lee commented 1 year ago

6.52 is out now.

johngoolsky commented 1 year ago

Works like a charm. Thanks again for the quick assist!

LiamWatson28 commented 1 year ago

Thanks all for the quick fix, I've now been able to create the project with 6.52.