GNU bug report logs - #39366
guix offload sometimes can use ~/.ssh/config, sometimes not

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 31 Jan 2020 06:51:01 UTC

Severity: normal

To reply to this bug, email your comments to 39366 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#39366; Package guix. (Fri, 31 Jan 2020 06:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 31 Jan 2020 06:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: bug-guix <bug-guix <at> gnu.org>
Subject: guix offload sometimes can use ~/.ssh/config, sometimes not
Date: Fri, 31 Jan 2020 01:50:53 -0500
"hurd" is a host name defined in my ~/.ssh/config file.

$ guix offload status
guix offload: getting status of 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: warning: machine 'hurd' is 31553985 seconds behind
load on machine 'hurd' is 0.02 (normalized: 0.02)
hurd
  kernel: Linux 5.1.2-gnu
  architecture: x86_64
  host name: hurd
  normalized load: 0.02
  free disk space: 950819.34 MiB
  time difference: -31553985 s

$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'hurd' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'hurd' is running GNU Guile 2.2.4
sending 1 store item (0 MiB) to '10.42.0.199'...
exporting path `/gnu/store/s9f3igal64f8c4k23jda5z24pfpzqxv6-export-test'
guix offload: 'hurd' successfully imported '/gnu/store/s9f3igal64f8c4k23jda5z24pfpzqxv6-export-test'
retrieving 1 store item from '10.42.0.199'...
guix offload: successfully imported
'/gnu/store/y7l8zymvqcnja6ybk8lzxncf9v0r5g79-import-test' from 'hurd'

$ guix build git --no-substitutes --check
process 31348 acquired build slot '/var/guix/offload/hurd:22/0'
guix offload: error: failed to connect to 'hurd': Failed to resolve hostname hurd (Name or service not known)
waiting for locks or build slots...

So, in many cases it seems able to use the information in ~/.ssh/config
to connect with the machine, but not when actually trying to offload
builds.

Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#39366; Package guix. (Wed, 05 Feb 2020 11:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 39366 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 39366 <at> debbugs.gnu.org
Subject: Re: bug#39366: guix offload sometimes can use ~/.ssh/config,
 sometimes not
Date: Wed, 05 Feb 2020 12:11:09 +0100
Hi,


Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> "hurd" is a host name defined in my ~/.ssh/config file.
>
> $ guix offload status
> guix offload: getting status of 1 build machines defined in '/etc/guix/machines.scm'...

[...]

> $ guix offload test
> guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
> guix offload: Guix is usable on 'hurd' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")

[...]

> $ guix build git --no-substitutes --check
> process 31348 acquired build slot '/var/guix/offload/hurd:22/0'
> guix offload: error: failed to connect to 'hurd': Failed to resolve hostname hurd (Name or service not known)

That is confusing indeed.  It comes from the fact that ‘guix offload’ in
the last case is running as root; thus, it sees a different
~/.ssh/config.

We could instruct ‘guix offload’ to always ignore ~/.ssh/config, but
that wouldn’t be great because using it can be useful.

Perhaps it should emit a warning when not running as root?

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#39366; Package guix. (Thu, 16 Dec 2021 13:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 39366 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39366 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#39366: guix offload sometimes can use ~/.ssh/config,
 sometimes not
Date: Thu, 16 Dec 2021 14:39:40 +0100
Hi,

On Wed, 05 Feb 2020 at 12:11, Ludovic Courtès <ludo <at> gnu.org> wrote:
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>
>> "hurd" is a host name defined in my ~/.ssh/config file.
>>
>> $ guix offload status
>> guix offload: getting status of 1 build machines defined in '/etc/guix/machines.scm'...
>
> [...]
>
>> $ guix offload test
>> guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
>> guix offload: Guix is usable on 'hurd' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
>
> [...]
>
>> $ guix build git --no-substitutes --check
>> process 31348 acquired build slot '/var/guix/offload/hurd:22/0'
>> guix offload: error: failed to connect to 'hurd': Failed to resolve hostname hurd (Name or service not known)
>
> That is confusing indeed.  It comes from the fact that ‘guix offload’ in
> the last case is running as root; thus, it sees a different
> ~/.ssh/config.

Therefore, see 52517. :-)  And the manual is also confusing, IMHO.

<http://issues.guix.gnu.org/issue/52517>


> We could instruct ‘guix offload’ to always ignore ~/.ssh/config, but
> that wouldn’t be great because using it can be useful.

Well, I am in favor of POLA.


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#39366; Package guix. (Mon, 03 Jan 2022 16:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 39366 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 39366 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#39366: guix offload sometimes can use ~/.ssh/config,
 sometimes not
Date: Mon, 03 Jan 2022 17:58:21 +0100
[Message part 1 (text/plain, inline)]
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> On Wed, 05 Feb 2020 at 12:11, Ludovic Courtès <ludo <at> gnu.org> wrote:

[...]

>> That is confusing indeed.  It comes from the fact that ‘guix offload’ in
>> the last case is running as root; thus, it sees a different
>> ~/.ssh/config.
>
> Therefore, see 52517. :-)  And the manual is also confusing, IMHO.
>
> <http://issues.guix.gnu.org/issue/52517>
>
>
>> We could instruct ‘guix offload’ to always ignore ~/.ssh/config, but
>> that wouldn’t be great because using it can be useful.
>
> Well, I am in favor of POLA.

Yeah, actually that would be in line with
bd8345777f5a48ee61656248655ebac71a09e926.

How about this:

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 9ddf458c13..925325ef5f 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -231,6 +231,9 @@ (define* (open-ssh-session machine #:optional max-silent-time)
                                ;; stateless instead.
                                #:knownhosts "/dev/null"
 
+                               ;; Likewise for ~/.ssh/config.
+                               #:config "/dev/null"
+
                                ;; We need lightweight compression when
                                ;; exchanging full archives.
                                #:compression
[Message part 3 (text/plain, inline)]
?

Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#39366; Package guix. (Mon, 03 Jan 2022 17:29:01 GMT) Full text and rfc822 format available.

Message #17 received at 39366 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 39366 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#39366: guix offload sometimes can use ~/.ssh/config,
 sometimes not
Date: Mon, 03 Jan 2022 18:24:30 +0100
Hi,

On Mon, 03 Jan 2022 at 17:58, Ludovic Courtès <ludo <at> gnu.org> wrote:

>>> We could instruct ‘guix offload’ to always ignore ~/.ssh/config, but
>>> that wouldn’t be great because using it can be useful.
>>
>> Well, I am in favor of POLA.
>
> Yeah, actually that would be in line with
> bd8345777f5a48ee61656248655ebac71a09e926.
>
> How about this:
>
> diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
> index 9ddf458c13..925325ef5f 100644
> --- a/guix/scripts/offload.scm
> +++ b/guix/scripts/offload.scm
> @@ -231,6 +231,9 @@ (define* (open-ssh-session machine #:optional max-silent-time)
>                                 ;; stateless instead.
>                                 #:knownhosts "/dev/null"
>  
> +                               ;; Likewise for ~/.ssh/config.
> +                               #:config "/dev/null"
> +
>                                 ;; We need lightweight compression when
>                                 ;; exchanging full archives.
>                                 #:compression

I am not enough familiar with this part of code but it sounds reasonable
since it is indeed aligned with the mentioned commit
bd8345777f5a48ee61656248655ebac71a09e926. :-)


Cheers,
simon




This bug report was last modified 2 years and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.