Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 498 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
docker login: error storing credentials `The stub received bad data.`

#1
First, I installed AWS-CLI and I already used "AWS configure" to set up my secret key and I also used "Docker login" command to log in and I got success and when I typed Get-ECRLoginCommand. It works and returns the result for me.

But when I try to use the command :

(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin 837859123533.dkr.ecr.ap-east-1.amazonaws.com/spring-boot

I got an error that looks like this:

> Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.``
Reply

#2
Both solutions worked for me, delete file C: \ Program Files \ Docker \ Docker \ resources \ bin \ docker-credential-desktop.exe and C: \ Program Files \ Docker \ Docker \ resources \ bin \ docker-credential-wincred. exe and delete {"credsStore": "...."} then my structure is as follows in the config.json file

{
"auths": {
"Account_AWS.dkr.ecr.Region_AWS.amazonaws.com": {
"auth": "My token"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client / 19.03.13 (windows)"
},
"stackOrchestrator": "swarm"
}
Reply

#3
As of today's date, this issue still persists. Below are the things I discovered-

1.) This problem shows up while using SSOs for authentication. I am using Azure SSO for AWS.(

[To see links please register here]

)

2.) The reason is- The token returned from SSOs is long enough(more than 2550 characters) where as windows credential manager does not support such long tokens.

3.) If you use ECR credential helper (

[To see links please register here]

), sadly it also does not seem to work with SSOs-

[To see links please register here]


However, I followed these steps as a workaround & I'm on Windows-

1.) Remove/Rename the `"docker-credential-wincred.exe"` file located in `"C:\Program Files\Docker\Docker\resources\bin"` directory.

2.) Remove the `"credStore"` & `"credsStore"` keys from the docker config(`C:\Users\PROFILE_NAME\.docker\config.json`).

I get the following response-

WARNING! Your password will be stored unencrypted in C:\Users\sandeep.kumar\.docker\config.json.
Configure a credential helper to remove this warning. See

[To see links please register here]


Login Succeeded

- Tickets opened to address this issue-

[To see links please register here]


[To see links please register here]

Reply

#4
As @Ethan Davis mentioned, **removing** the following files helped me:

- `C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe`
- `C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe`
Reply

#5
**Edit:** Also see Ethan Davis's solution:

> I found that removing C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe and C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe worked for me. – Ethan Davis Sep 29 '20 at 18:10

---

**Original:** The solution [linked by Joelster's comment](

[To see links please register here]

) worked for me.

> One quick workaround is to modify <User folder>\.docker\config.json file. **Remove the following line** so docker will use file system to store tokens:

> "credsStore": "wincred"


I opened the file `c:\Users\sashoalm\.docker\config.json`, and I deleted the "credsStore" key. After that this worked:

type pass.txt | docker login -u AWS --password-stdin

[To see links please register here]


And the output was this:

WARNING! Your password will be stored unencrypted in C:\Users\sashoalm\.docker\config.json.
Configure a credential helper to remove this warning. See

[To see links please register here]


Login Succeeded
Reply

#6
from another thread -

[To see links please register here]

solution helps on Mac-os : `mv ~/.docker ~/.docker.bak`
Reply

#7
Fixed by just deleted "credsStore": "desktop" in config.json file.
Reply

#8
With the most recent version of Docker `amazon-ecr-credential-helper` is installed alongside it.

So you only need to activate it by modifying your `config.json` file, found in `%userprofile%/.docker/config.json` or `~/.docker/config.json`.

Set the contents of your `config.json` to be:

```
{
"credsStore": "ecr-login"
}
```

Alternatively you can also set the contents to:
```
{
"auths": {
"XXXXXXXXXXXX.dkr.ecr.ap-east-1.amazonaws.com": {
"auth": ""
}
}
}
```
(Where XXXXXXXXXXXX is the AWS Account number, ap-east-1 is the region of choice, and auth is left blank).

Now if you repeat the `docker login --username AWS XXXXXXXXXXXX.dkr.ecr.ap-east-1.amazonaws.com` then it will succeed this time.


The full instructions can be found on Amazon's [amazon-ecr-credential-helper](

[To see links please register here]

) page.
Reply

#9
Nothing worked for me, so I installed the Amazon ECR Docker Credential Helper, so you do not need to `docker login` at all.

choco install amazon-ecr-credential-helper

Place the docker-credential-ecr-login binary on your PATH and set the contents of your ~/.docker/config.json file to be:

{
"credsStore": "ecr-login"
}

Official Repo:

[To see links please register here]


Edit: In Windows you can download the `amazon-ecr-credential-helper` from here

[To see links please register here]

and install it as described here:

[To see links please register here]


Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through