Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot recognize credential profile name with leading empty space like [ default] #8170

Closed
forkercat opened this issue Sep 11, 2023 · 3 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@forkercat
Copy link

Describe the bug

Related to this issue in aws-sdk-cpp: aws/aws-sdk-cpp#2650

aws-sdk-cpp 1.11.136 might persist profile names with leading empty space like [ default] and [ my-dev]`.

Then when I used the AWS CLI tool to call some AWS services it shows that the profile cannot be read.

Unable to locate credentials. You can configure credentials by running "aws configure".

Expected Behavior

The AWS CLI should recognize the empty space before the name and ignore the spaces.

Current Behavior

The AWS CLI is not functioning when there are leading empty spaces.

Reproduction Steps

You can manually test it by opening ~/.aws/credentials and adding empty spaces before the default profile name. Then try to use the tool to interact with some AWS services like S3.

FYI, I tried it with aws gamelift.

aws gamelift create-game-session --location custom-location-unreal-us-west-2 --fleet-id fleet-b0032ace-04ff-4923-8502-c1a4f393e0a7 --name GameSession_1 --maximum-player-session-count 3

Possible Solution

No response

Additional Information/Context

No response

CLI version used

2.11.18

Environment details (OS name and version, etc.)

Python/3.11.3 Windows/10 exe/AMD64 prompt/off

@forkercat forkercat added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 11, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Sep 12, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added p3 This is a minor priority issue investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 12, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @forkercat, thanks for reaching out. I'm not sure this is really a bug. Profiles with a leading space are being read correctly by the CLI. I tested this with a profile named ' testUser', and used aws s3 ls --profile " testUser", which worked fine. The issue would be specifically with the default profile, since the CLI looks for that profile name if none are specified. As a workaround, you can still specify the profile you want to use (--profile " default"). I'm not sure that changing the behavior here makes sense, since, in theory, leading empty space profile names should only be created intentionally.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Sep 12, 2023
@forkercat
Copy link
Author

OK. It looks like it only happens to default profile. I think we can close it.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants