aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.6k stars 4.14k forks source link

pcluster configure with sso broken after https://github.com/aws/aws-cli/issues/9092 #9107

Closed ggscorzato closed 2 days ago

ggscorzato commented 3 days ago

Describe the bug

following https://docs.aws.amazon.com/parallelcluster/latest/ug/install-v3-configuring.html (but with sso) the command pcluster configure --config config-file.yaml should guide through the build of a config-file.yaml for a cluster

However, it replies Failed with error: Unable to locate credentials

Regression Issue

Expected Behavior

the command pcluster configure --config config-file.yaml should guide through the build of a config-file.yaml for a cluster

Current Behavior

the command pcluster configure --config config-file.yaml Failed with error: Unable to locate credentials

Reproduction Steps

$aws --version
aws-cli/2.22.4 Python/3.12.6 Linux/4.18.0-553.27.1.el8_10.x86_64 exe/x86_64.rocky.8

$pcluster version
{
  "version": "3.11.1"
}

$aws configure sso --use-device-code
$aws sso login --profile AWSAdministratorAccess-XXX --use-device-code
$cat .aws/config
[profile AWSAdministratorAccess-XXX]
sso_session = my-sso
sso_account_id = XXX
sso_role_name = AWSAdministratorAccess
region = eu-north-1
output = json
[sso-session my-sso]
sso_start_url = https://ZZZ.awsapps.com/start/#
sso_region = eu-west-1
sso_registration_scopes = sso:account:access

$pcluster configure --config config-file.yaml  --region eu-north-1
Failed with error: Unable to locate credentials
$export AWS_PROFILE=AWSAdministratorAccess-XXX
$pcluster configure --config config-file.yaml  --region eu-north-1
Failed with error: The config profile (AWSAdministratorAccess-XXX) could not be found

Possible Solution

check whether https://github.com/aws/aws-cli/issues/9092 might have broken some compatibility with pcluster

Additional Information/Context

No response

CLI version used

aws-cli/2.22.4

Environment details (OS name and version, etc.)

Python/3.12.6 Linux/4.18.0-553.27.1.el8_10.x86_64 exe/x86_64.rocky.8

tim-finnigan commented 3 days ago

Thanks for reaching out. Since this issue involves the pcluster CLI, can you also report the issue here in this repository: https://github.com/aws/aws-parallelcluster/issues? You can get the logs for further investigation.

For the AWS CLI aws sso login command, can you share the output and debug logs (with any sensitive info redacted)? You can get those logs by adding --debug to your command.

The conclusion from https://github.com/aws/aws-cli/issues/9092 was that things are working as expected, so I'm not sure that there's a compatibility issue here.

ggscorzato commented 2 days ago

restarting from a clean environment and using the latest awscli 2.22.6, the issue is not reproduced. Closing.

github-actions[bot] commented 2 days 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.