All of lore.kernel.org
 help / color / mirror / Atom feed
* Fetcher issue: Error communicating with gnome-keyring-daemon
@ 2016-04-22  9:38 Esponde, Joel
  2016-04-22 12:53 ` Esponde, Joel
  2016-04-22 16:05 ` Burton, Ross
  0 siblings, 2 replies; 5+ messages in thread
From: Esponde, Joel @ 2016-04-22  9:38 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2664 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 13309 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Fetcher issue: Error communicating with gnome-keyring-daemon
  2016-04-22  9:38 Fetcher issue: Error communicating with gnome-keyring-daemon Esponde, Joel
@ 2016-04-22 12:53 ` Esponde, Joel
  2016-04-22 16:05 ` Burton, Ross
  1 sibling, 0 replies; 5+ messages in thread
From: Esponde, Joel @ 2016-04-22 12:53 UTC (permalink / raw)
  To: Esponde, Joel, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 3525 bytes --]

I found another way to give access to Gnome Keyring by just adding this to the recipe:

# We needs to export DBUS_SESSION_BUS_ADDRESS in git fetcher environment to let
# git be able to access Gnome Keyring through D-Bus
def getDSBA(d):
    origenv = d.getVar("BB_ORIGENV", False)
    dsba = origenv.getVar("DBUS_SESSION_BUS_ADDRESS", False)
    #print("dsba: " + dsba)
    return dsba
FETCHCMD_git = "export DBUS_SESSION_BUS_ADDRESS=${@getDSBA(d)}; git -c core.fsyncobjectfiles=0"

Joël Esponde
Honeywell | Sensing and Productivity Solutions

De : bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-devel-bounces@lists.openembedded.org] De la part de Esponde, Joel
Envoyé : vendredi 22 avril 2016 11:38
À : bitbake-devel@lists.openembedded.org
Objet : [bitbake-devel] Fetcher issue: Error communicating with gnome-keyring-daemon

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


[-- Attachment #2: Type: text/html, Size: 22548 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Fetcher issue: Error communicating with gnome-keyring-daemon
  2016-04-22  9:38 Fetcher issue: Error communicating with gnome-keyring-daemon Esponde, Joel
  2016-04-22 12:53 ` Esponde, Joel
@ 2016-04-22 16:05 ` Burton, Ross
  2016-04-22 16:21   ` Esponde, Joel
  1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-04-22 16:05 UTC (permalink / raw)
  To: Esponde, Joel; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

Hi Joel,

On 22 April 2016 at 10:38, Esponde, Joel <Joel.Esponde@honeywell.com> wrote:

> 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:
>
>
I think what would work best is a mashup of both approaches: extracting the
variables you need from BB_ORIGINENV but injecting them into the
environment in runfetchcmd.

I don't use gnome-keyring so I can't test it, but can you see if this patch
works for you:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ross/mut&id=60afb3b2eb222815776e8d2e13647e12def363a2

Cheers,
Ross

[-- Attachment #2: Type: text/html, Size: 1523 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fetcher issue: Error communicating with gnome-keyring-daemon
  2016-04-22 16:05 ` Burton, Ross
@ 2016-04-22 16:21   ` Esponde, Joel
  2016-04-26  8:59     ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Esponde, Joel @ 2016-04-22 16:21 UTC (permalink / raw)
  To: Burton, Ross; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

Hi Ross,

I just tried your patch.
And it works just fine!

Your commit perfectly fits to our need.
Just a little word on commit’s comment, authentication is not done in this case over ssh it is done over https. So this fix is more generic than what the comment may let think.

Thanks a lot for having taken time to look at my email and for having answered so quickly and efficiently!

Joël Esponde
Honeywell | Sensing and Productivity Solutions

De : Burton, Ross [mailto:ross.burton@intel.com]
Envoyé : vendredi 22 avril 2016 18:06
À : Esponde, Joel
Cc : bitbake-devel@lists.openembedded.org
Objet : Re: [bitbake-devel] Fetcher issue: Error communicating with gnome-keyring-daemon

Hi Joel,

On 22 April 2016 at 10:38, Esponde, Joel <Joel.Esponde@honeywell.com<mailto:Joel.Esponde@honeywell.com>> wrote:
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:

I think what would work best is a mashup of both approaches: extracting the variables you need from BB_ORIGINENV but injecting them into the environment in runfetchcmd.

I don't use gnome-keyring so I can't test it, but can you see if this patch works for you:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ross/mut&id=60afb3b2eb222815776e8d2e13647e12def363a2

Cheers,
Ross

[-- Attachment #2: Type: text/html, Size: 6893 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fetcher issue: Error communicating with gnome-keyring-daemon
  2016-04-22 16:21   ` Esponde, Joel
@ 2016-04-26  8:59     ` Burton, Ross
  0 siblings, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2016-04-26  8:59 UTC (permalink / raw)
  To: Esponde, Joel; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On 22 April 2016 at 17:21, Esponde, Joel <Joel.Esponde@honeywell.com> wrote:

> I just tried your patch.
>
> And it works just fine!
>
>
>
> Your commit perfectly fits to our need.
>
> Just a little word on commit’s comment, authentication is not done in this
> case over ssh it is done over https. So this fix is more generic than what
> the comment may let think.
>
>
>
> Thanks a lot for having taken time to look at my email and for having
> answered so quickly and efficiently!
>

Great, I've updated the message locally.  Thanks for testing the code.

Ross

[-- Attachment #2: Type: text/html, Size: 1929 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-26  8:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-22  9:38 Fetcher issue: Error communicating with gnome-keyring-daemon Esponde, Joel
2016-04-22 12:53 ` Esponde, Joel
2016-04-22 16:05 ` Burton, Ross
2016-04-22 16:21   ` Esponde, Joel
2016-04-26  8:59     ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.