aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.54k stars 4.13k forks source link

"aws configure sso" fails unhelpfully with invalid SSO session names #7643

Closed gbenson closed 1 day ago

gbenson commented 1 year ago

Describe the bug

aws configure sso fails with a cryptic error message if an invalid SSO session name is supplied.

Expected Behavior

It'd be nice to have an informative error message:

$ aws configure sso
SSO session name (Recommended): AWS on Chromebook

Error: "AWS on Chromebook" is not a valid session name (try "aws-on-chromebook" instead?)

Current Behavior

$ aws configure sso
SSO session name (Recommended): AWS on Chromebook
SSO start URL [None]: https://whatever.awsapps.com/start
SSO region [None]: us-east-1
SSO registration scopes [sso:account:access]:

An error occurred (InvalidClientMetadataException) when calling the RegisterClient operation:

There's nothing more, the command terminates there. Possibly a traceback got eaten somewhere?

Reproduction Steps

Run aws configure sso and give it an SSO session name with whitespace in it.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.9.21

Environment details (OS name and version, etc.)

Python/3.9.11 Linux/5.10.153-20434-g98da1eb2cf9d exe/x86_64.debian.11 prompt/off

tim-finnigan commented 1 year ago

Thanks @gbenson for reporting this issue, I could reproduce the behavior you described. It looks like a client-side validator could be added here to ensure that the SSO Session Name doesn't contain spaces: https://github.com/aws/aws-cli/blob/dc53215d2b2eae803907dbd19e22836ec2c26d38/awscli/customizations/configure/sso.py#L209-L228

tim-finnigan commented 1 day ago

Upon revisiting this and testing again, it appears that the issue has since been fixed. Please update to a recent version (2.18.16 is the latest per the CHANGELOG) and let us know if you're still seeing any issues.

github-actions[bot] commented 1 day ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.