Using an http proxy, derivation failed

  • Open
  • quality assurance status badge
Details
3 participants
  • dal-blazej
  • Josselin Poiret
  • Ludovic Courtès
Owner
unassigned
Submitted by
dal-blazej
Severity
normal
D
D
dal-blazej wrote on 9 Feb 2022 20:21
(address . bug-guix@gnu.org)
87pmnvj170.fsf@onenetbeyond.org
Hi,

I am trying to get Guix in a QubesOS/debian 11 template. QubesOS expose a proxy
in its templates, used mostly by apt and dnf.

For some reason all my attempts to modify the systemd unit were
un-successful so I simply exported it on the command line. However as
you can see in the following backtrace, that is not working as expected.

$ export https_proxy=http://localhost:8082/; guix pull
hint: Consider installing the `glibc-locales' package and defining `GUIX_LOCPATH', along these lines:

guix install glibc-locales
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"

See the "Application Setup" section in the manual, for more info.

Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
Computing Guix derivation for 'x86_64-linux'... \substitute: hint: Consider installing the `glibc-utf8-locales' or `glibc-locales' package and
substitute: defining `GUIX_LOCPATH', along these lines:
substitute:
substitute: guix install glibc-utf8-locales
substitute: export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
substitute:
substitute: See the "Application Setup" section in the manual, for more info.
substitute:
hint: Consider installing the `glibc-utf8-locales' or `glibc-locales' package and
defining `GUIX_LOCPATH', along these lines:

guix install glibc-utf8-locales
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"

See the "Application Setup" section in the manual, for more info.

guix substitute: error: host name lookup error: Name or service not known
Backtrace:
14 (primitive-load "/gnu/store/m8ipcivlnaqr4y9hpxiiqi2pn1wldcia-compute-guix-derivation")
In ice-9/eval.scm:
155:9 13 (_ _)
159:9 12 (_ #(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#(#<directory (guile-u?> ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?))
In ice-9/boot-9.scm:
152:2 11 (with-fluid* _ _ _)
152:2 10 (with-fluid* _ _ _)
In ./guix/store.scm:
2129:24 9 (run-with-store #<store-connection 256.99 7400779ab140> #<procedure 740061d42d20 at ./guix/self.scm:12?> ?)
1966:8 8 (_ #<store-connection 256.99 7400779ab140>)
In ./guix/gexp.scm:
296:22 7 (_ #<store-connection 256.99 7400779ab140>)
1180:2 6 (_ #<store-connection 256.99 7400779ab140>)
1046:2 5 (_ #<store-connection 256.99 7400779ab140>)
892:4 4 (_ #<store-connection 256.99 7400779ab140>)
In ./guix/store.scm:
2014:12 3 (_ #<store-connection 256.99 7400779ab140>)
1406:5 2 (map/accumulate-builds #<store-connection 256.99 7400779ab140> #<procedure 740072c0d640 at ./guix/stor?> ?)
1421:15 1 (_ #<store-connection 256.99 7400779ab140> ("/gnu/store/gmi62pbnf0jfish26chd7pvfzs2rzlxa-guile-ssh-?" ?) ?)
1421:15 0 (loop #f)

./guix/store.scm:1421:15: In procedure loop:
ERROR:
1. &store-protocol-error:
message: "some substitutes for the outputs of derivation `/gnu/store/ak595vg1ij7vf3vxx3srk60dvwz6zxry-gnutls-3.7.2.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source "
status: 1
guix pull: error: You found a bug: the program '/gnu/store/m8ipcivlnaqr4y9hpxiiqi2pn1wldcia-compute-guix-derivation'
failed to compute the derivation for Guix (version: "515406f20f0f2a69f8701ce3ece8121dbc4fb5dd"; system: "x86_64-linux";
host version: "4578ad78bee1dfd450962627ae66d3e15ebadad2"; pull-version: 1).
Please report the COMPLETE output above by email to <bug-guix@gnu.org>.
J
J
Josselin Poiret wrote on 12 Feb 2022 12:21
87fsoomiu4.fsf@jpoiret.xyz
Hello,
dal-blazej--- via Bug reports for GNU Guix <bug-guix@gnu.org> writes:

Toggle quote (9 lines)
> Hi,
>
> I am trying to get Guix in a QubesOS/debian 11 template. QubesOS expose a proxy
> in its templates, used mostly by apt and dnf.
>
> For some reason all my attempts to modify the systemd unit were
> un-successful so I simply exported it on the command line. However as
> you can see in the following backtrace, that is not working as expected.

As noted in the manual, the guix daemon itself (and not the commands
that communicate with it) needs to have the https_proxy environment
variable set. What went wrong while modifying the systemd unit?

Best,
--
Josselin Poiret
D
D
dal-blazej wrote on 2 Mar 2022 15:50
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 53904@debbugs.gnu.org)
877d9ccstb.fsf@onenetbeyond.org
Hi debbugs,

The following mails was not CC to 53904@debbugs.gnu.org so let's correct
that :


* 1 dal to jpoiret

Hi Josselin,

Josselin Poiret <dev@jpoiret.xyz> writes:
Toggle quote (2 lines)
> What went wrong while modifying the systemd unit?

The systemd unit file from debian looks like that
(I only added the https_proxy, with localhost or 127.0.0.1, with or
without the leading http://):

#+begin_src conf :tangle "/etc/systemd/system/guix-daemon.service"
# This is a "service unit file" for the systemd init system to launch
# 'guix-daemon'. Drop it in /etc/systemd/system or similar to have
# 'guix-daemon' automatically started.

[Unit]
Description=Build daemon for GNU Guix

[Service]
ExecStart=/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
Environment='GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8 'https_proxy=http://localhost:8082/'
RemainAfterExit=yes
StandardOutput=syslog
StandardError=syslog

# Some package builds (for example, go@1.8.1) may require even more than
# 1024 tasks.
TasksMax=8192

[Install]
WantedBy=multi-user.target
#+end_src

After reloading the daemons and restarting the daemon :

guix pull: error: failed to connect to `/var/guix/daemon-socket/socket': Connection refused

By the way, I previously tested the proxy itself via wget and it
works. I also tried some others variations on the unit file without more success.


* 2 jpoiret to dal

Hello,

dal-blazej@onenetbeyond.org writes:
Toggle quote (7 lines)
> After reloading the daemons and restarting the daemon :
>
> guix pull: error: failed to connect to `/var/guix/daemon-socket/socket': Connection refused
>
> By the way, I previously tested the proxy itself via wget and it
> works. I also tried some others variations on the unit file without more success.

I'm not very familiar with the Debian Guix package, but can you check
that /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon does
indeed exist? If not, you may need to log-in as root, and run `guix
pull` there. Did the systemd unit ever work, and if not, how do you run
the Guix daemon?

Best,
--
Josselin Poiret


* 3 dal to jpoiret

Thanks for your help Josselin.

I precise that I am able to run guix in a debian standaloneVM without proxy.

I feared to have messed up something in that template so I started again
from scratch.

- I modified /usr/lib/systemd/system/guix-daemon.service and
/usr/lib/systemd/system/guix-publish.service to use

Toggle quote (3 lines)
> I'm not very familiar with the Debian Guix package, but can you check
> that /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon does
> indeed exist?
- /var/guix/profiles/per-user/root/current-guix doesn't exist.

Toggle quote (1 lines)
> If not, you may need to log-in as root, and run `guix pull` there.
- guix pull (as user or root) :

#+begin_exemple
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix pull: error: Git error: failed to resolve address for
git.savannah.gnu.org: Temporary failure in name resolution
#+end_exemple


I am still able to use my proxy with wget.

Toggle quote (2 lines)
> Did the systemd unit ever work, and if not, how do you run
> the Guix daemon?
- guix-daemon.service is now running without error.

- guix-publish.service throw an error (but I guess it is another issue):

#+begin_exemple
? guix-publish.service - Publish the GNU Guix store
Loaded: loaded (/lib/systemd/system/guix-publish.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2022-02-17 16:44:00 CET; 7min ago
Process: 7397 ExecStart=/usr/bin/guix publish --user=nobody --port=8181 (code=exited, status=1/FAILURE)
Main PID: 7397 (code=exited, status=1/FAILURE)
CPU: 184ms

Feb 17 16:44:00 localhost systemd[1]: Started Publish the GNU Guix store.
Feb 17 16:44:00 localhost guix[7397]: guix publish: error: open-file: No such file or directory: "/etc/guix/signing-key.pub"
Feb 17 16:44:00 localhost systemd[1]: guix-publish.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 16:44:00 localhost systemd[1]: guix-publish.service: Failed with result 'exit-code'.
#+end_exemple
L
L
Ludovic Courtès wrote on 8 Mar 2022 09:42
(address . dal-blazej@onenetbeyond.org)
87wnh496ot.fsf@gnu.org
Hi,

dal-blazej@onenetbeyond.org skribis:

Toggle quote (4 lines)
> The systemd unit file from debian looks like that
> (I only added the https_proxy, with localhost or 127.0.0.1, with or
> without the leading http://):

[...]

Toggle quote (4 lines)
> [Service]
> ExecStart=/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
> Environment='GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8 'https_proxy=http://localhost:8082/'

Looks good to me.

Toggle quote (4 lines)
> After reloading the daemons and restarting the daemon :
>
> guix pull: error: failed to connect to `/var/guix/daemon-socket/socket': Connection refused

This suggests that guix-daemon is not running. Could it be that it
failed to start? Does ‘journalctl -u guix-daemon.service’ contain any
clue?

BTW, according to the output you pasted earlier (in particular the noisy
locale warnings), it seems that your daemon needs an update. Check out

Thanks,
Ludo’.
D
D
dal-blazej wrote on 8 Mar 2022 20:35
(name . Ludovic Courtès)(address . ludo@gnu.org)
878rtkz17o.fsf@onenetbeyond.org
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (10 lines)
>> guix pull: error: failed to connect to `/var/guix/daemon-socket/socket': Connection refused
>
> This suggests that guix-daemon is not running. Could it be that it
> failed to start? Does ‘journalctl -u guix-daemon.service’ contain any
> clue?
>
> BTW, according to the output you pasted earlier (in particular the noisy
> locale warnings), it seems that your daemon needs an update. Check out
> <https://guix.gnu.org/manual/devel/en/html_node/Upgrading-Guix.html>.

Yes It needs an update but it can't. That's the issue ;)

Sorry, I think my CC error has lead to some confusion.

My last mail stated I started from scratch (new virtual machine, new
guix installation) :
- with the https_proxy defined inside the systems service file.
- with the daemon running
So please, ignore the first errors.

In this case the error seems clearly that :
$ guix pull
use git, and _guix does not pass to git the https_proxy_.

Fortunately I can update by passing the https_proxy on the command:
$ https_proxy=https://127.0.0.1:8082guix pull

To make it clear, both the variable in the systemd service file and on
the command line are necessary to successfully run guix pull.

But as you stated it shouldn't, it still looks like a bug.
?