Region from ~/.aws/config includes an inline comment, so every AWS call fails
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- aws, typescript
- Domain
- cli
Research direction
Start with src/core/region.ts, especially regionFromConfigFile, and compare its handling of shared config values with the @smithy/core/config parseIni behavior described in the issue. Reproduce with a default profile line such as region = us-west-2 # main region and no region environment variables. Done when the CLI resolves us-west-2 and the described AWS command no longer fails.
Written by the indexing model from the issue text.
Description
Description
When no --region, AWS_REGION or AWS_DEFAULT_REGION is set, the CLI reads the region from the
shared config file itself (regionFromConfigFile in src/core/region.ts). It keeps everything
after =, so a comment on the same line becomes part of the region. The AWS SDK's own ini parser
strips such comments, so the same file works with the AWS CLI and SDKs.
Steps to Reproduce
~/.aws/config:[default] region = us-west-2 # main region- Unset
AWS_REGION/AWS_DEFAULT_REGIONand run any command, e.g.agentcore harness list --json.
Expected Behavior
The CLI uses us-west-2, as aws configure get region and the SDK do.
Actual Behavior
The region is us-west-2 # main region, and the SDK rejects it:
Region not accepted: region="us-west-2 # main region" is not a valid hostname component.
CLI Version
1.2.0 (current v1.x, a6452a4)
Operating System
Linux
Additional Context
The SDK (@smithy/core/config parseIni) drops #/; comments at line start or after
whitespace. The CLI's parser also matches any key that merely starts with region.
- Dominant language
- TypeScript
- Stars
- 339
- Forks
- 129
- Avg merge
- 19h 21m
- Merged PRs (30d)
- 125
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/agentcore-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws/agentcore-cli#2940 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aws/agentcore-cli#2938 ·
Maintainers usually reply within 1 day
-
invoke: CUSTOM_JWT runtime errors discard the response body and error type (e.g. "Token has expired")Possibly taken @n1dhruv claimed this 6 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/agentcore-cli#2875 · 1 comment ·
Maintainers usually reply within 1 day
-
--debug has no effect; service error name, HTTP status and request ID never reach the terminalPossibly taken @abhiramshaji-cyber claimed this 3 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws/agentcore-cli#2874 ·
Maintainers usually reply within 1 day
-
`agentcore dev` container fails with LoginTokenLoadError when using `aws login` credentialsPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
aws/agentcore-cli#2606 · 4 comments ·
Maintainers usually reply within 1 day
All issues in aws/agentcore-cli
Similar issues
-
bot:ai-assisted component:faucet status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
midnightntwrk/midnight-faucet-api#222 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bluesky-social/social-app#12545 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
knaw-huc/textannoviz#742 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cloudflare/realtimekit-ui#219 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cdklabs/cdk-nextjs#365 ·
Maintainers usually reply within 1 day