[bitbake-devel] Fetcher issue: Error communicating with gnome-keyring-daemon

Esponde, Joel Joel.Esponde at Honeywell.com
Fri Apr 22 09:38:19 UTC 2016


Hi,

When bitbake tries to fetch code from a git repository that needs authentication whose credentials are stored in Gnome Keyring, it fails and produces this error:

    ** (process:53010): CRITICAL **: Error communicating with gnome-keyring-daemon
    fatal: could not read Username for 'https://git.someserver.com': No such device or address


git-credential-gnomekeyring is the helper used by git to store credentials in Gnome Keyring.
git-credential-gnomekeyring uses D-Bus to communicate with Gnome Keyring when X or Gnome environment is not accessible (for example, through SSH).
Therefore, *.bashrc* is modified like this during *git-credential-gnomekeyring* installation:

    # git-credential-gnome-keyring:
    # If you are connected to your workstation via SSH, you'll need to set up D-Bus,
    # or else you'll get Error communicating with gnome-keyring-daemon.
    # The solution is to add the following to your .bashrc or .zshrc file:
    if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then
        if [[ -f ~/.dbus/session-bus/$(dbus-uuidgen --get)-0 ]]; then
            source ~/.dbus/session-bus/$(dbus-uuidgen --get)-0
            export DBUS_SESSION_BUS_ADDRESS
        fi
    fi

So one way to allow bitbake's fetcher access Gnome Keyring is to avoid DBUS_SESSION_BUS_ADDRESS variable being removed from bitbake's fetcher environment.

This can be achieved in those two steps:


-          First, fetcher's code needs to stop filtering DBUS_SESSION_BUS_ADDRESS, here is the fix:

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index b004dae..392e307 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -784,7 +784,8 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
                   'ALL_PROXY', 'all_proxy',
                   'GIT_PROXY_COMMAND',
                   'SSH_AUTH_SOCK', 'SSH_AGENT_PID',
-                  'SOCKS5_USER', 'SOCKS5_PASSWD']
+                  'SOCKS5_USER', 'SOCKS5_PASSWD',
+                  'DBUS_SESSION_BUS_ADDRESS']
     for var in exportvars:
         val = d.getVar(var, True)


-          Secondly, bitbake needs also to stop filtering DBUS_SESSION_BUS_ADDRESS thanks to its environment set like this:

$ export BB_ENV_EXTRAWHITE="DBUS_SESSION_BUS_ADDRESS"

What do you think about this fix?

My main concern about this solution is that any user that would store his git's credentials in Gnome Keyring would have to set BB_ENV_EXTRAWHITE before being able to use bitbake... It does not look like very handy...

Joël Esponde
Honeywell | Sensing and Productivity Solutions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160422/862073b3/attachment-0002.html>


More information about the bitbake-devel mailing list