tinkerbell / tink

Workflow Engine for provisioning Bare Metal
https://tinkerbell.org
Apache License 2.0
913 stars 134 forks source link

./setup.sh Cannot autolaunch D-Bus without X11 $DISPLAY #180

Closed fransvanberckel closed 4 years ago

fransvanberckel commented 4 years ago

While ./setup.sh I have got this error.

-- Creating deploy_registry_1 ... done -- Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

Bare metal server, installed today with Ubuntu 18.04, minimal netinst.iso. Q: Is running setup over ssh the problem?

fransvanberckel commented 4 years ago

It's about using the docker-compose package from the Ubuntu 18.04 repos ...

setup.sh: echo -n "$TINKERBELL_REGISTRY_PASSWORD" | docker login -u="$TINKERBELL_REGISTRY_USERNAME" --password-stdin "$TINKERBELL_HOST_IP"

Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

Work-around from hyperlink ... -- Since this is a bug in the Ubuntu packaging for server it needs to be fixed there but in the meantime a work-around without having to uninstall docker-compose temporarily or having to switch to the docker repos instead you can make it use pass instead. This is what I did:

$ sudo apt install gnupg2 pass $ gpg2 --full-generate-key

This generates a you a gpg2 key, After that's done you can list it with

$ gpg2 -k

Copy the key id (from the line labelled [pub]) and do

$ pass init "whatever key id you have"

After that docker login worked fine since it defaults to use pass and only tries to fallback to secretservice if it can't find it. secretservice seems to have an X11 dependency which isn't present on a basic server install.

Side effect is that you get a somewhat more secure credentials store or on your server instead of a base64 encoded json file.