Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EdgeXS opened this issue Apr 12, 2019 · 19 comments

Comments

@EdgeXS
Copy link

EdgeXS commented Apr 12, 2019

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?

@mcallaghan-bsm
Copy link

mcallaghan-bsm commented Apr 26, 2019

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
Copy link

edvardm commented Jul 11, 2019

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
Copy link

jrpalma commented Feb 15, 2020

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

@weiwongfaye
Copy link

upgrade to v0.6.3 works for me too

@ha2la
Copy link

ha2la commented Jun 8, 2022

I fixed it with the following commands:

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

@Ap3lsin4k
Copy link

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
Copy link

DamirShamsutdinov commented Jul 28, 2022

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`

This was referenced Jul 28, 2022
Closed
@su-shubham
Copy link

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

@ramesh-m99
Copy link

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

@EdygerM
Copy link

EdygerM commented Nov 25, 2022

I fixed it with the following commands:

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

It worked, thank you

@fpmanuel
Copy link

fpmanuel commented May 3, 2023

I fixed it with the following commands:

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

This worked!

@blulightspecial
Copy link

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
Copy link

Follow the doc, please.

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

@wakamex
Copy link

wakamex commented Jul 11, 2023

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

@Cupcc
Copy link

Cupcc commented Dec 12, 2023

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

@cowlinator
Copy link

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

@lovetheguitar
Copy link

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
Copy link

Lufen34 commented Jul 23, 2024

Problem still there an none of the solution online worked ... 😞

@rickymal
Copy link

rickymal commented Oct 9, 2024

this sequence worked for me:
service docker stop
rm ~/.docker/config.json
service docker start

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests