binbashar / le-docker-leverage-toolbox

Docker image for https://github.com/binbashar/leverage
3 stars 0 forks source link

Error with sso login process #29

Closed juanmatias closed 1 year ago

juanmatias commented 1 year ago

As per this Slack chat, verify the reported issue.

Describe the Bug

When login with SSO and then executing an init command, Leverage CLI says AWS SSO token has expired.

Note and research the fact this error was reported in the newest Toolbox image: 1.2.7-0.1.0.

Expected Behavior

When it is known the token is still valid Leverage CLI should use this token.

Steps to Reproduce

Steps to reproduce the behavior:

  1. cd into le-tf-infra-aws/apps-devstg/us-east-1/k8s-eks/cluster
  2. leverage aws configure sso and configure the SSO
  3. leverage terraform init

Output

Output from configure step:

[19:49:54]    INFO  Account profiles written successfully!

Output from last step:

[16:50:07.066] INFO     Checking environment name definition in account.tfvars...
[16:50:07.071] INFO     ✔ OK

[16:50:07.077] INFO     Checking backend key...
[16:50:07.078] INFO     Found: 'apps-devstg/k8s-eks/cluster/terraform.tfstate'
[16:50:07.079] INFO     ✔ OK

[16:50:07.082] INFO     Checking backend.tfvars:

[16:50:07.083] INFO     Checking if profile starts with bb-apps-devstg...
[16:50:07.084] INFO     ✔ OK

[16:50:07.085] INFO     Checking if bucket starts with bb-apps-devstg...
[16:50:07.087] INFO     ✔ OK

[16:50:07.088] INFO     Checking if dynamodb table starts with bb-apps-devstg...
[16:50:07.089] INFO     ✔ OK

[16:50:07.734] ERROR    AWS SSO token has expired, please log back in.

Environment (please complete the following information):

Running Leverage CLI (and Toolbox) on Mac

Additional Context

This error happened previously with old Toolbox images. Note that in earlier versions of Leverage CLI 1.8.0 the Toolbox image set was 1.2.7-latest.

If Leverage CLI was run when latest was pointing to an image with the problem, this image was downloaded to local and then, it doesn't matter if the latest is updated in docker hub, it won´t download it again. This could result in the latest local image pointing to an old image instead of the new one (1.2.7-0.0.5). For sake of testing you can:

juanmatias commented 1 year ago

Testing with:

There is a braking change between Leverage CLI 1.8.0 and Toolbox 1.2.7-0.1.0. Solution: Toolbox versions have to be fixed in build.env.

exequielrafaela commented 1 year ago

As @juanmatias described in the previous message in case you hit this error please consider installing and setting up your Ref Arch build.env with one of the following working compatible versions:

📒 NOTE: We'll also keep updated the https://leverage.binbash.com.ar/work-with-us/releases/versions-compatibility-matrix/