Paul1896
Paul1896

Reputation: 119

Git + libsecret throws "Cannot autolaunch D-Bus without X11 $DISPLAY"

I've installed Git and libsecret on an CentOS 7 Server. I used git-credentials-store to store my credentials in clear text on the server. Now I wanna use libsecret but unfortunately I'm getting D-Bus errors, if I configure git-credential-libsecret as credential helper.

I've already installed dbus and dbus-x11 and launched dbus via below command but I'm still getting errors.

dbus-launch --sh-syntax

Error:

$ git pull origin master

** (process:66155): CRITICAL **: 08:19:33.936: could not connect to Secret Service: Cannot autolaunch D-Bus without X11 $DISPLAY

** (process:66160): CRITICAL **: 08:19:34.209: store failed: Cannot autolaunch D-Bus without X11 $DISPLAY

EDIT:

After installation of gnome-keyring I get the following error

** Message: 14:10:49.566: Remote error from secret service: org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.Secret.Collection' on object at path /org/freedesktop/secrets/collection/login

Upvotes: 9

Views: 13476

Answers (2)

dragon788
dragon788

Reputation: 3931

You can run it headless, but you need to follow the recommendations from the Python keyring package to "trick" it.

https://keyring.readthedocs.io/en/latest/#using-keyring-on-headless-linux-systems

Upvotes: 0

Philip Withnall
Philip Withnall

Reputation: 5743

You need to use export $(dbus-launch) to evaluate the variables which dbus-launch outputs, so that ${DBUS_SESSION_BUS_ADDRESS} is set in your environment. See also: How to export DBUS_SESSION_BUS_ADDRESS

If ${DBUS_SESSION_BUS_ADDRESS} is not set in your environment, the D-Bus client library will assume no dbus-daemon is running and will attempt to auto-launch one. Without a ${DISPLAY}, that’s not possible; hence the error message you see.

Upvotes: 6

Related Questions