docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.07k stars 170 forks source link

Error saving credentials: error storing credentials - err: exit status 1, out: `pass store is uninitialized` #140

Open EdgeXS opened 5 years ago

EdgeXS commented 5 years ago

I've successfully got it to install and work but the issue is it's not consistent.

Error:

Expectation:

using

Troubleshooting:

gpg --list-keys /root/.gnupg/pubring.gpg '------------------------' pub 2048R/12312312 2019-03-23 uid Name email@email.com sub 2048R/23423423 2019-03-23

pass init 12312312 Password store initialized for 12312312

docker login username:

It shouldn't request the username and password it should just use the existing credentials. Why isn't it loading the key for 12312312

what's the fix?

mcallaghan-bsm commented 5 years ago

Same here. Struggling with incomplete documentation.

The pass + GPG setup works fine.

gpg --list-keys
...
pub   2048R/02FDF8FE 2019-04-26
...

Init the pass

pass init 02FDF8FE
Password store initialized for 02FDF8FE.

$ cat ~/.password-store/.gpg-id 
02FDF8FE

One can insert a password fine (this is a MANUAL confirmation of the init check, later I confirm that it is automatically created)

$ pass insert docker-credential-helpers/docker-pass-initialized-check
mkdir: created directory ‘/home/USER/.password-store/docker-credential-helpers’
Enter password for docker-credential-helpers/docker-pass-initialized-check: 
Retype password for docker-credential-helpers/docker-pass-initialized-check: 

$ pass ls
Password Store
└── docker-credential-helpers
    └── docker-pass-initialized-check

$ pass insert docker-credential-pass/docker-pass-initialized-check
mkdir: created directory ‘/home/USER/.password-store/docker-credential-pass’
Enter password for docker-credential-pass/docker-pass-initialized-check: 
Retype password for docker-credential-pass/docker-pass-initialized-check: 

$ pass ls
Password Store
├── docker-credential-helpers
│   └── docker-pass-initialized-check
└── docker-credential-pass
    └── docker-pass-initialized-check

Docker is configured to use pass:

$ grep creds ~/.docker/config.json 
    "credsStore": "pass",

as per https://docs.docker.com/engine/reference/commandline/login/#login-to-a-self-hosted-registry

Docker login succeeds, though fails to store the password:

$ docker login PERSONAL_REGISTRY
Username: gitlab+deploy-token-X
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `pass store is uninitialized`

I wish it would tell us WHICH PASS STORE is unit'd!?

But if we try to run it manually it hangs for a LONG TIME

$ ~/bin/docker-credential-pass 
<<SLOW>>
Usage: /home/USER/bin/docker-credential-pass <store|get|erase|list|version>
<<FINALLY>

that was really slow to tell me ... how slow?

$ time ~/bin/docker-credential-pass list
pass store is uninitialized

real    1m0.347s
user    0m0.032s
sys 0m0.024s

Here's finally a reproduction of the error

$ ~/bin/docker-credential-pass list
<<SLOW>> (~1min)
pass store is uninitialized

Lies!

$ pass list
Password Store
└── docker-credential-helpers
    └── docker-pass-initialized-check

$ pass show docker-credential-helpers/docker-pass-initialized-check
pass is initialized

Version is latest

$ ~/bin/docker-credential-pass version
0.6.0
edvardm commented 5 years ago

Same here, followed all the steps but still:

λ pass show docker-credential-helpers/docker-pass-initialized-check
pass is initialized
λ docker-credential-pass list                                      
pass store is uninitialized
λ jq '.credsStore' < ~/.docker/config.json 
"pass"

Some more information: checked commits, and commit d6c1f13 changed initialization checking logic in such a way that adding that docker-pass-initialized-check is no longer necessary (it just calls pass ls). Don't know why it doesn't still work.

jrpalma commented 4 years ago

I was having the same issue. I tried the lastest version v0.6.3 and that worked.

weiwongfaye commented 4 years ago

upgrade to v0.6.3 works for me too

ha2la commented 2 years ago

I fixed it with the following commands:

service docker stop
rm ~/.docker/config.json
service docker start
Ap3lsin4k commented 2 years ago

I had non-empty config.json. The error is counter-intuitive.

$ echo $CR_PAT | docker login ghcr.io -u Ap3lsin4k --password-stdin
Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `pass not initialized: exit status 1: Error: password store is empty. Try "pass init".``
$ echo $CR_PAT | wc --chars
41

Answer from @ha2la works for me:

$ service docker stop
$ rm ~/.docker/config.json
$ echo $CR_PAT | docker login ghcr.io -u Ap3lsin4k --password-stdin
Login Succeeded
DamirShamsutdinov commented 2 years ago

I try use answer @ha2la And before many of this tred But then i enter docker login -u ... and password Terminal show me Error saving credentials: error storing credentials - err: exit status 1, out:pass store is uninitialized`

su-shubham commented 2 years ago

@ha2la Works fine after stopping and starting docker services and removing json file

ramesh-m99 commented 1 year ago

@ha2la its working thanks service docker stop rm ~/.docker/config.json service docker start

EdygerM commented 1 year ago

I fixed it with the following commands:

service docker stop
rm ~/.docker/config.json
service docker start

It worked, thank you

fpmanuel commented 1 year ago

I fixed it with the following commands:

service docker stop
rm ~/.docker/config.json
service docker start

This worked!

blulightspecial commented 1 year ago

I fixed it with the following commands:

service docker stop
rm ~/.docker/config.json
service docker start

This definitely works, but it's just reverting to storing your password in plain text as the warning message notes:

WARNING! Your password will be stored unencrypted in /home/{your_name}/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
joao-invernal commented 1 year ago

Follow the doc, please.

Link: https://docs.docker.com/desktop/get-started/#credentials-management-for-linux-users

wakamex commented 1 year ago

if you want a GPG key without a password, run gpg --batch --passphrase '' --quick-gen-key your@email.com default default

Cupcc commented 9 months ago

Run this command : sudo docker login. And then input your token. It worked for me.

cowlinator commented 9 months ago

@Cupcc, be aware that sudo docker login uses /root/.docker/config.json instead of ~/.docker/config.json.

lovetheguitar commented 2 months ago

For me all the instructions did not work, until I added a trailing slash to the registry url (GitLab CI docker registry, if it matters).

Lufen34 commented 1 month ago

Problem still there an none of the solution online worked ... :disappointed: