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

All cmdlets fail with "Request headers must contain only ASCII characters." for some locales #188

Open
eriklz opened this issue Jan 25, 2021 · 3 comments
Labels
bug This issue is a bug. module/powershell-cmdlets p2 This is a standard priority issue queued

Comments

@eriklz
Copy link

eriklz commented Jan 25, 2021

Description

If I run any AWS cmdlet from AWS.Tools that communicate with AWS services fail after about 35 seconds with the error message "Request headers must contain only ASCII characters.".

$PSCulture is set to sv-SE in PowerShell.

If I go into macOS system settings and change regional locale settings to country USA instead of Sweden, then run the same thing, it works just fine.

Also, if I start a pwsh terminal session in VS Code, it defaults to en-US for $PSCulture, even if the system locale is set to Sweden (sv-SE). In VS Code terminal it also works fine there.

Presumably since Swedish includes a few non-ASCII characters in the alphabet, this may be part of what is causing the problem here. I noticed that there was a query from 2019 in the AWS community forums for PowerShell scripting where a person had the same issue on macOS (10.15), with no response. So it does not seem to be a new issue.

Reproduction Steps

  1. In macOS regional settings, change the country to Sweden and change the primary language to Sweden. Accept all changes as-is.
  2. Start an Apple Terminal with pwsh
  3. Verify that $PSCulture is set to 'sv-SE'
  4. Run any AWS cmdlet that uses AWS services

Logs

With $PSCulture = 'sv-SE':
PS /Users/erikl> Get-EC2Vpc -ProfileName erik -region eu-west-1 -verbose -Debug
DEBUG: Credentials obtained from stored profile named 'erik'
DEBUG: Region obtained from region parameter with value 'eu-west-1'
VERBOSE: Invoking Amazon Elastic Compute Cloud (EC2) operation 'DescribeVpcs' in region 'eu-west-1'
Get-EC2Vpc: Request headers must contain only ASCII characters.

with $PSCulture = 'en-US' or $PSCulture = '':
PS /Users/erikl> Get-EC2Vpc -ProfileName erik -region eu-west-1 -verbose -Debug
DEBUG: Credentials obtained from stored profile named 'erik'
DEBUG: Region obtained from region parameter with value 'eu-west-1'
VERBOSE: Invoking Amazon Elastic Compute Cloud (EC2) operation 'DescribeVpcs' in region 'eu-west-1'

CidrBlock : 172.31.0.0/16
CidrBlockAssociationSet : {vpc-cidr-assoc-1dfa7777}
DhcpOptionsId : dopt-3baf7999
InstanceTenancy : default
Ipv6CidrBlockAssociationSet : {}
IsDefault : True
OwnerId : 123456789012
State : available
Tags : {}
VpcId : vpc-6f741111

Environment

AWS Tools for PowerShell 4.1.7.0.
macOS 11.1 (BigSur)
PowerShell 7.1.1

Tested in Apple Terminal and VS Code terminal, see above.

Resolution


This is a 🐛 bug-report

@eriklz eriklz added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 25, 2021
@ashishdhingra ashishdhingra added module/powershell-cmdlets and removed needs-triage This issue or PR still needs to be triaged. labels Jan 25, 2021
@ashishdhingra
Copy link
Contributor

Easily reproducible using the following steps:

  • In 'System Preferences' > Language & Region, set Region as Sweden and primary language in Preferred languages as Svenska - Swedish.

Skärmavbild 2021-01-25 kl  13 06 56

  • Open MacOS terminal.

  • Verify that output of $PSCulture is sv-SE. Then execute the command Get-EC2Vpc -region eu-west-1 -verbose -Debug. It gives error Get-EC2Vpc: Request headers must contain only ASCII characters..

Screenshot 2021-01-25 at 13 12 29

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 23, 2022
@ashishdhingra
Copy link
Contributor

Do not auto close

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 24, 2022
aws-sdk-dotnet-automation pushed a commit that referenced this issue Mar 8, 2022
Add ErrorActionPreference variable to CodeBuild action
@ashishdhingra ashishdhingra added p2 This is a standard priority issue and removed A labels Nov 1, 2022
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. module/powershell-cmdlets p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

3 participants