all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing HTTP proxy settings in GuixSD
@ 2017-10-26 13:21 Konrad Hinsen
  2017-10-27  0:41 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Konrad Hinsen @ 2017-10-26 13:21 UTC (permalink / raw)
  To: guix-devel

Hi everyone,

I wonder if anyone else has had the problem I describe below and knows a 
solution.

I am running GuixSD in a virtual machine on a laptop that I use in 
different network environments. One of them requires the use of a HTTP 
proxy, direct accesses being blocked. As a consequence, the Guix build 
daemon fails when downloading anything.

After reading the manual, I come to the conclusion that the only way to 
change the HTTP proxy settings for the build daemon is via 
(guix-configuration ...), which requires to do "guix system reconfigure".
Unfortunately that command fails because it tries to download stuff (no 
idea why, BTW, I didn't do a "guix pull" since I last used it) and 
fails. It looks like I'd have to reconfigure while I am still in a 
working network environment, meaning I'd have to anticipate switching 
networks, which I can't.

More generally, it would be nice to have to be able to change network 
settings without reconfiguring and rebooting. But at first, I'd be happy 
if I could get my system to work at all.

Any ideas?

Konrad.

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-10-26 13:21 Changing HTTP proxy settings in GuixSD Konrad Hinsen
@ 2017-10-27  0:41 ` Ludovic Courtès
  2017-11-06 17:20   ` Konrad Hinsen
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2017-10-27  0:41 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

Hello!

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

> I am running GuixSD in a virtual machine on a laptop that I use in
> different network environments. One of them requires the use of a HTTP
> proxy, direct accesses being blocked. As a consequence, the Guix build
> daemon fails when downloading anything.
>
> After reading the manual, I come to the conclusion that the only way
> to change the HTTP proxy settings for the build daemon is via
> (guix-configuration ...), which requires to do "guix system
> reconfigure".
> Unfortunately that command fails because it tries to download stuff
> (no idea why, BTW, I didn't do a "guix pull" since I last used it) and
> fails. It looks like I'd have to reconfigure while I am still in a
> working network environment, meaning I'd have to anticipate switching
> networks, which I can't.

Not that it helps you much, but there’s an open bug on this topic:
<https://bugs.gnu.org/25569>.

> More generally, it would be nice to have to be able to change network
> settings without reconfiguring and rebooting. But at first, I'd be
> happy if I could get my system to work at all.

I agree.

A quick workaround would be to do something along these lines:

  # herd stop guix-daemon
  # http_proxy=… guix-daemon --build-users-group=guixbuild
  # guix system reconfigure config.scm

where config.scm has the relevant proxy configuration of in
‘guix-configuration’.

Would that work for you?

HTH,
Ludo’.

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-10-27  0:41 ` Ludovic Courtès
@ 2017-11-06 17:20   ` Konrad Hinsen
  2017-11-10  5:28     ` Chris Marusich
  0 siblings, 1 reply; 10+ messages in thread
From: Konrad Hinsen @ 2017-11-06 17:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi Ludo,

> A quick workaround would be to do something along these lines:
> 
>    # herd stop guix-daemon
>    # http_proxy=… guix-daemon --build-users-group=guixbuild
>    # guix system reconfigure config.scm
> 
> where config.scm has the relevant proxy configuration of in
> ‘guix-configuration’.
> 
> Would that work for you?

No. Downloads fail with messages of the type

ERROR: Wrong type to apply: "mirror.hydra.gnu.org"

This looks like the proxy returns something that guix-daemon doesn't 
expect. Unfortunately, this may well be the fault of my institutions 
proxy, which has caused lots of people lots of trouble of various kinds.

Konrad.

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-06 17:20   ` Konrad Hinsen
@ 2017-11-10  5:28     ` Chris Marusich
  2017-11-10  9:05       ` Konrad Hinsen
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Marusich @ 2017-11-10  5:28 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

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

Konrad Hinsen <konrad.hinsen@fastmail.net> writes:

>> A quick workaround would be to do something along these lines:
>>
>>    # herd stop guix-daemon
>>    # http_proxy=… guix-daemon --build-users-group=guixbuild
>>    # guix system reconfigure config.scm
>>
>> where config.scm has the relevant proxy configuration of in
>> ‘guix-configuration’.
>>
>> Would that work for you?
>
> No. Downloads fail with messages of the type
>
> ERROR: Wrong type to apply: "mirror.hydra.gnu.org"
>
> This looks like the proxy returns something that guix-daemon doesn't
> expect. Unfortunately, this may well be the fault of my institutions
> proxy, which has caused lots of people lots of trouble of various
> kinds.

That error looks suspicious.  Perhaps you already know this, but it
probably means that the string "mirror.hydra.gnu.org" wound up being
used where a procedure should probably have been used instead.  For
example, in your Guile REPL, you can reproduce this kind of error like
this:

    scheme@(guile-user)> ("this is not a procedure")
    ERROR: ERROR: Wrong type to apply: "this is not a procedure"

The workaround that Ludo described, in which you temporarily stop the
guix-daemon, and then start it in an environment where http_proxy is set
appropriately, should work.  If it isn't, then can I ask to see the
commands and conigs you're using which fail?

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-10  5:28     ` Chris Marusich
@ 2017-11-10  9:05       ` Konrad Hinsen
  2017-11-10 22:15         ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Konrad Hinsen @ 2017-11-10  9:05 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

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

Hi Chris,

> That error looks suspicious.  Perhaps you already know this, but it
> probably means that the string "mirror.hydra.gnu.org" wound up being
> used where a procedure should probably have been used instead.  For
> example, in your Guile REPL, you can reproduce this kind of error like
> this:
>
>     scheme@(guile-user)> ("this is not a procedure")
>     ERROR: ERROR: Wrong type to apply: "this is not a procedure"

Suspicious indeed...

> The workaround that Ludo described, in which you temporarily stop the
> guix-daemon, and then start it in an environment where http_proxy is set
> appropriately, should work.

That's exactly what I did.

> If it isn't, then can I ask to see the commands and conigs you're
> using which fail?

Here are the commands I typed:

   sudo -s
   herd stop guix-daemon
   http_proxy=http://proxy.synchrotron-soleil.fr:8080/  guix-daemon --build-users-group=guixbuild
   guix system reconfigure /etc/config.scm

The config I used in this first test (attached) is exactly the same one
I am currently running, with no reference to the proxy at all. I was
planning to add that in a second step.

Konrad.


[-- Attachment #2: config.scm --]
[-- Type: application/octet-stream, Size: 1938 bytes --]

;; This is an operating system configuration template
;; for a "bare bones" setup, with no X11 display server.

(use-modules (gnu))
(use-service-modules networking ssh nfs)
(use-package-modules admin nfs)

(operating-system
  (host-name "guixsd")
  (timezone "Europe/Paris")
  (locale "en_US.utf8")

  ;; Assuming /dev/sdX is the target hard disk, and "my-root" is
  ;; the label of the target root file system.
  (bootloader (grub-configuration (target "/dev/sda")))
  (file-systems (cons* (file-system
                         (device "root")
                         (title 'label)
                         (mount-point "/")
                         (type "ext4"))
                       %base-file-systems))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "hinsen")
                (comment "only user")
                (group "users")

                ;; Adding the account to the "wheel" group
                ;; makes it a sudoer.  Adding it to "audio"
                ;; and "video" allows the user to play sound
                ;; and access the webcam.
                (supplementary-groups '("wheel"
                                        "audio" "video"))
                (home-directory "/home/hinsen"))
               %base-user-accounts))

  ;; Globally-installed packages.
  (packages (cons* tcpdump nfs-utils %base-packages))

  ;; Add services to the baseline: a DHCP client and
  ;; an SSH server, plus a statically configured network adapter.
  (services (cons* (service openssh-service-type
                            (openssh-configuration
                              (port-number 22)))
                   (dhcp-client-service)
                   (service rpcbind-service-type
                            (rpcbind-configuration))
                   %base-services)))

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-10  9:05       ` Konrad Hinsen
@ 2017-11-10 22:15         ` Ludovic Courtès
  2017-11-10 22:29           ` ng0
                             ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-11-10 22:15 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

Hi Konrad,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

>> That error looks suspicious.  Perhaps you already know this, but it
>> probably means that the string "mirror.hydra.gnu.org" wound up being
>> used where a procedure should probably have been used instead.  For
>> example, in your Guile REPL, you can reproduce this kind of error like
>> this:
>>
>>     scheme@(guile-user)> ("this is not a procedure")
>>     ERROR: ERROR: Wrong type to apply: "this is not a procedure"
>
> Suspicious indeed...

It turned out to come from a typo in Guile 2.2’s web client, now fixed
here:

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56

and I’ve done some monkey-patching here:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=59da6f04f45b36696a9385babab3080d7d854fba

I’ll update the ‘guix’ package soon so that this change is available to
daemon-side code such as ‘guix substitute’.  In the meantime you can run
the daemon from a checkout:

  sudo -E ./pre-inst-env guix-daemon …

For reference, I used this command to test proxy support:

  http_proxy=http://localhost:8118 \
  ./pre-inst-env guix download http://www.gnu.org

where Privoxy is listening to localhost:8118.

Thanks for reporting the issue!

Ludo’.

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-10 22:15         ` Ludovic Courtès
@ 2017-11-10 22:29           ` ng0
  2017-11-11 10:12           ` Mark H Weaver
  2017-11-16  9:21           ` Konrad Hinsen
  2 siblings, 0 replies; 10+ messages in thread
From: ng0 @ 2017-11-10 22:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

Ludovic Courtès transcribed 1.4K bytes:
> Hi Konrad,
> 
> Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:
> 
> >> That error looks suspicious.  Perhaps you already know this, but it
> >> probably means that the string "mirror.hydra.gnu.org" wound up being
> >> used where a procedure should probably have been used instead.  For
> >> example, in your Guile REPL, you can reproduce this kind of error like
> >> this:
> >>
> >>     scheme@(guile-user)> ("this is not a procedure")
> >>     ERROR: ERROR: Wrong type to apply: "this is not a procedure"
> >
> > Suspicious indeed...
> 
> It turned out to come from a typo in Guile 2.2’s web client, now fixed
> here:
> 
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56
> 
> and I’ve done some monkey-patching here:
> 
>   https://git.savannah.gnu.org/cgit/guix.git/commit/?id=59da6f04f45b36696a9385babab3080d7d854fba
> 
> I’ll update the ‘guix’ package soon so that this change is available to
> daemon-side code such as ‘guix substitute’.  In the meantime you can run
> the daemon from a checkout:
> 
>   sudo -E ./pre-inst-env guix-daemon …
> 
> For reference, I used this command to test proxy support:
> 
>   http_proxy=http://localhost:8118 \
>   ./pre-inst-env guix download http://www.gnu.org
> 
> where Privoxy is listening to localhost:8118.
> 
> Thanks for reporting the issue!
> 
> Ludo’.

Oh. I think I encountered a similar (or the same?) problem one
year ago without ever reporting it.
I'll check soon if my usecase is fixed with your latest commits.

Thanks for working on this!
-- 
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://dl.n0.is/dist/keys/
  WWW: https://we.make.ritual.n0.is

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-10 22:15         ` Ludovic Courtès
  2017-11-10 22:29           ` ng0
@ 2017-11-11 10:12           ` Mark H Weaver
  2017-11-11 14:20             ` Ludovic Courtès
  2017-11-16  9:21           ` Konrad Hinsen
  2 siblings, 1 reply; 10+ messages in thread
From: Mark H Weaver @ 2017-11-11 10:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi,

ludo@gnu.org (Ludovic Courtès) writes:
> It turned out to come from a typo in Guile 2.2’s web client, now fixed
> here:
>
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56

[...]

> diff --git a/module/web/http.scm b/module/web/http.scm
> index 993b50e..62f0624 100644
> --- a/module/web/http.scm
> +++ b/module/web/http.scm
> [...]
> @@ -1158,7 +1158,7 @@ three values: the method, the URI, and the version."
>          (put-symbol port scheme)
>          (put-string port "://")
>          (cond
> -         ((host string-index #\:)
> +         ((string-index host #\:)
>            (put-char #\[ port)
>            (put-string port host
>            (put-char port #\])))

There are 4 typos in the cond clause above, all introduced in this
commit:

  https://git.savannah.gnu.org/cgit/guile.git/commit/?id=96b994b6f815747ce2548123cc996d8132bd4781

which includes:

-         ((string-index host #\:)
-          (display #\[ port)
-          (display host port)
-          (display #\] port))
+         ((host string-index #\:)
+          (put-char #\[ port)
+          (put-string port host
+          (put-char port #\])))

In addition to the typo you fixed:

* The first call to 'put-char' above has its arguments reversed.
* The following line is missing its ')'.
* The last line has an extra ')'.

       Mark

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-11 10:12           ` Mark H Weaver
@ 2017-11-11 14:20             ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-11-11 14:20 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>> It turned out to come from a typo in Guile 2.2’s web client, now fixed
>> here:
>>
>>   https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56
>
> [...]
>
>> diff --git a/module/web/http.scm b/module/web/http.scm
>> index 993b50e..62f0624 100644
>> --- a/module/web/http.scm
>> +++ b/module/web/http.scm
>> [...]
>> @@ -1158,7 +1158,7 @@ three values: the method, the URI, and the version."
>>          (put-symbol port scheme)
>>          (put-string port "://")
>>          (cond
>> -         ((host string-index #\:)
>> +         ((string-index host #\:)
>>            (put-char #\[ port)
>>            (put-string port host
>>            (put-char port #\])))
>
> There are 4 typos in the cond clause above, all introduced in this
> commit:
>
>   https://git.savannah.gnu.org/cgit/guile.git/commit/?id=96b994b6f815747ce2548123cc996d8132bd4781
>
> which includes:
>
> -         ((string-index host #\:)
> -          (display #\[ port)
> -          (display host port)
> -          (display #\] port))
> +         ((host string-index #\:)
> +          (put-char #\[ port)
> +          (put-string port host
> +          (put-char port #\])))
>
> In addition to the typo you fixed:
>
> * The first call to 'put-char' above has its arguments reversed.
> * The following line is missing its ')'.
> * The last line has an extra ')'.

Ouch, good catch.  I pushed appropriate fixes.

If you spot more, feel free to fix them directly!  :-)

Thanks,
Ludo’.

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

* Re: Changing HTTP proxy settings in GuixSD
  2017-11-10 22:15         ` Ludovic Courtès
  2017-11-10 22:29           ` ng0
  2017-11-11 10:12           ` Mark H Weaver
@ 2017-11-16  9:21           ` Konrad Hinsen
  2 siblings, 0 replies; 10+ messages in thread
From: Konrad Hinsen @ 2017-11-16  9:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi Ludo,

> I’ll update the ‘guix’ package soon so that this change is available to
> daemon-side code such as ‘guix substitute’.  In the meantime you can run
> the daemon from a checkout:
>
>   sudo -E ./pre-inst-env guix-daemon …

That works fine - thanks!

Konrad.

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

end of thread, other threads:[~2017-11-16  9:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 13:21 Changing HTTP proxy settings in GuixSD Konrad Hinsen
2017-10-27  0:41 ` Ludovic Courtès
2017-11-06 17:20   ` Konrad Hinsen
2017-11-10  5:28     ` Chris Marusich
2017-11-10  9:05       ` Konrad Hinsen
2017-11-10 22:15         ` Ludovic Courtès
2017-11-10 22:29           ` ng0
2017-11-11 10:12           ` Mark H Weaver
2017-11-11 14:20             ` Ludovic Courtès
2017-11-16  9:21           ` Konrad Hinsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.