You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A duplicated profile leads to useless "Unable to parse config file" #9261
In case you create a duplication of an existing profile, aws-cli just reports "Unable to parse config file .aws/config" without any clue of the offending profile.
It would make sense to report the line number and the source reason of parse failure which may be difficult to guess when working with few hundreds of lines in configuration.
Thank you in advance
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
It would make sense to report the line number and the source reason of parsing failure: duplicated profile "xxx" at line yyy
Current Behavior
Reports only: Unable to parse config file: C:\Users\zzzzzz/.aws/config
Reproduction Steps
Duplicate a profile with same name in .aws/config for instance
[profile test]
region = eu-central-1
output = json
[profile test]
region = eu-central-1
output = json
Possible Solution
A fix suggestion: reports line number and the source reason of parse failure:
Unable to parse config file: C:\Users\zzzzzz/.aws/config`. Duplicated declaration of profile 'test' at line 5.
Hi @ymartin59, thanks for reaching out. I was able to reproduce this behavior, but I don't think it really counts as a bug. However, I do see the value in having a more detailed error message here. I'll bring it up with the team for review.
Hey, thanks for your patience. We're going to be closing this feature request at this time. Right now, as you pointed out, all malformed profile errors produce the same error, and changing that would require writing an entirely new parser. We'll be taking a backlog item to add more detailed information about handling config file parsing errors in the AWS CLI troubleshooting guide. Thanks again for opening this.
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.
Activity
RyanFitzSimmonsAK commentedon Jan 30, 2025
Hi @ymartin59, thanks for reaching out. I was able to reproduce this behavior, but I don't think it really counts as a bug. However, I do see the value in having a more detailed error message here. I'll bring it up with the team for review.
RyanFitzSimmonsAK commentedon Feb 3, 2025
Hey, thanks for your patience. We're going to be closing this feature request at this time. Right now, as you pointed out, all malformed profile errors produce the same error, and changing that would require writing an entirely new parser. We'll be taking a backlog item to add more detailed information about handling config file parsing errors in the AWS CLI troubleshooting guide. Thanks again for opening this.
github-actions commentedon Feb 3, 2025
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.