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

"Error from list function in secretservice_linux.c likely due to error in secretservice library"

Open freeone3000 opened this issue 5 years ago • 3 comments

I'm using the release of docker-credential-secretservice v0.6.3. I get the following error when running docker-credential-secretservice list: Error from list function in secretservice_linux.c likely due to error in secretservice library

This error is the same whether I build v0.6.3 from source, master from source, or use the .tar.gz provided on the Releases section.

This error appears to be session-dependant - opening a new terminal window no longer causes the error. Some basic shell information (given randomly): https://gist.github.com/freeone3000/655e1e33c863a7a3f7a09fc4f9eda1dd

freeone3000 avatar Jan 24 '20 20:01 freeone3000

Issue appears to go away if X forwarding is removed, so the easiest way to reproduce is to start a session without starting X, and attempt to run docker-compose where docker-credential-secretservice is required.

freeone3000 avatar Jan 27 '20 16:01 freeone3000

I just ran into this. It was trying to pop up a GUI to unlock the keyring, but since I was ssh'ed in and didn't have graphics forwarding, it gave this unclear error.

This should reproduce the error easily by "disabling" X temporarily:

DISPLAY= docker-credential-secretservice list

and in my case, making X forwarding work made the error message go away.

andyneff avatar Jan 20 '21 12:01 andyneff

Since it appears no progress is being made on this, and many people working remotely now over ssh, I will at least offer a hacky work around:

  1. Create two config jsons in your ~/.docker dir. (config.json and configX.json, in my case)
  2. configX.json should have secretservice in it, config.json should not
  3. In your ~/.bashrc add the following
if timeout 1 xset q &> /dev/null; then
  export DOCKER_CONFIG=~/.docker/configX.json
# else
#   export DOCKER_CONFIG=~/.docker/config.json
fi

This has MANY drawbacks, including but not limited to:

  • Not DRY, you have to remember to change two files, and keep them in sync. You could get clever and create an "config_autogenerated_x.json" files by either sed, cating pieces together, or ep (envplate), but for my purposes, my config is simple enough I don't care about this
  • If you X status changes while you are still running bash, this will obviously not update. Again, you could work around this by writing a docker function in your bash rc that checks every time the docker command is run, but this won't help in scripts or docker-compose or other clients.
  • If bash is not your shell of choice, you'd have to figure out the same for your shell, etc...

But at least when you get back logging into a computer graphically, secretservice will be used again.

andyneff avatar Feb 15 '21 16:02 andyneff