Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
I'm trying to authenticate Docker to ECR registry placed in Milan region (eu-south-1) but all I get is the following error
Error saving credentials: error storing credentials - err: exit status 1, out:
error storing credentials - err: exit status 1, out:
The stub received bad data.``
The command I use the following
aws ecr get-login-password --profile [profile_name] --region eu-south-1 | docker login --username AWS --password-stdin [aws_account_id].dkr.ecr.eu-south-1.amazonaws.com
The region for the account is enabled. If I specify another region (ie: eu-west-1) the login succeed.
I get the same error even using AWS PowerShell Tools so maybe the problem is not related to AWS CLI (v2)
SDK version number
aws-cli/2.0.7 Python/3.7.5 Windows/10 botocore/2.0.0dev11
Platform/OS/Hardware/Device
Windows 10 Pro (build 19041) and WSL2
To Reproduce (observed behavior)
aws ecr get-login-password --profile [profile_name] --region eu-south-1 | docker login --username AWS --password-stdin [aws_account_id].dkr.ecr.eu-south-1.amazonaws.com
Expected behavior
Login Succeeded
Logs/output
.
Additional context
By using another region the login succeed
Hi @n-dallacosta, sorry to hear of the issue!
This is likely the same issue as in https://github.com/aws/aws-cli/issues/5636. The authentication token can be of different lengths depending on the environment, and there is a known limitation of the Windows Credential Manager, which cannot support credentials greater than 2500 characters (see https://github.com/aws/aws-cli/issues/5636#issuecomment-709665379).
I found that the token for the region eu-south-1 (Milan) is about 2700 characters while for eu-west-1 (Ireland) is about 1900. Windows Credentials Manager has a limit of 2500 characters so that is the cause of the problem
Wow, that was a fast response, @n-dallacosta! Thanks for confirming. Since this is a known issue and tracked in https://github.com/aws/aws-cli/issues/5636, I'll close this now.
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.