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

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

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?

About this issue

Most upvoted comments

I fixed it with the following commands:

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

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

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

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

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

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

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

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`

upgrade to v0.6.3 works for me too