Subject: bug#53904: Using an http proxy, derivation failed

From: [email-masked]
Date: Wed, 02 Mar 2022 15:50:08 +0100

Hi debbugs,

The following mails was not CC to [email-masked] so let's correct
that :

* 1 dal to jpoiret

Hi Josselin,

Josselin Poiret <[email-masked]> writes:
> 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

# See <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00608.html>.
# Some package builds (for example, [email-masked]) 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,

[email-masked] writes:
> 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
  https_proxy=http:///127.0.0.1:8082

> 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.

> 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.

> 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