docker-credential-helpers icon indicating copy to clipboard operation
docker-credential-helpers copied to clipboard

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

Open EdgeXS opened this issue 5 years ago • 19 comments

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

Error:

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

Expectation:

  • Use the existing credentials

using

  • https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452
  • https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388974092

Troubleshooting:

gpg --list-keys /root/.gnupg/pubring.gpg '------------------------' pub 2048R/12312312 2019-03-23 uid Name [email protected] 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?

EdgeXS avatar Apr 12 '19 01:04 EdgeXS

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

mcallaghan-bsm avatar Apr 26 '19 23:04 mcallaghan-bsm

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.

edvardm avatar Jul 11 '19 12:07 edvardm

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

jrpalma avatar Feb 15 '20 00:02 jrpalma

upgrade to v0.6.3 works for me too

weiwongfaye avatar Mar 19 '20 05:03 weiwongfaye

I fixed it with the following commands:

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

ha2la avatar Jun 08 '22 08:06 ha2la

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

Ap3lsin4k avatar Jul 08 '22 09:07 Ap3lsin4k

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`

DamirShamsutdinov avatar Jul 28 '22 23:07 DamirShamsutdinov

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

su-shubham avatar Aug 11 '22 14:08 su-shubham

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

ramesh-m99 avatar Oct 25 '22 18:10 ramesh-m99

I fixed it with the following commands:

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

It worked, thank you

EdygerM avatar Nov 25 '22 10:11 EdygerM

I fixed it with the following commands:

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

This worked!

fpmanuel avatar May 03 '23 13:05 fpmanuel

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

blulightspecial avatar May 13 '23 02:05 blulightspecial

Follow the doc, please.

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

Mr-Sena avatar Jun 29 '23 00:06 Mr-Sena

if you want a GPG key without a password, run gpg --batch --passphrase '' --quick-gen-key [email protected] default default

wakamex avatar Jul 11 '23 18:07 wakamex

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

Cupcc avatar Dec 12 '23 01:12 Cupcc

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

cowlinator avatar Dec 13 '23 20:12 cowlinator