GNU bug report logs - #30706
'guix system reconfigure' can fail to load new system services

Previous Next

Package: guix;

Reported by: Andreas Enge <andreas <at> enge.fr>

Date: Sun, 4 Mar 2018 23:07:02 UTC

Severity: important

To reply to this bug, email your comments to 30706 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#30706; Package guix. (Sun, 04 Mar 2018 23:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Enge <andreas <at> enge.fr>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 04 Mar 2018 23:07:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: guix-devel <at> gnu.org
Cc: bug-guix <at> gnu.org
Subject: Re: Nginx service fails
Date: Mon, 5 Mar 2018 00:06:37 +0100
Well, I am turning this into a bug report, since it still occurs with
the latest git commit ac1a9ce8b07f3b80900ee08436ff6e683e8dc195 .

This is the result of "./pre-inst-env guix system reconfigure ...",
where "..." is my configuration file:

...
creating nginx log directory '/var/log/nginx'
creating nginx run directory '/var/run/nginx'
creating nginx temp directories '/var/run/nginx/{client_body,proxy,fastcgi,uwsgi,scgi}_temp'
nginx: [alert] could not open error log file: open() "/gnu/store/pp71iff1qxwhh82vm34g18h9kmn0xrg5-nginx-1.13.9/logs/error.log" failed (2: No such file or directory)
nginx: the configuration file /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf syntax is ok
nginx: configuration file /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf test is successful
`/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/root' -> `/etc/ssh/authorized_keys.d/root'
`/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/andreas' -> `/etc/ssh/authorized_keys.d/andreas'
guix system: loading new services: user-homes term-auto nginx...
shepherd: Evaluating user expression (register-services (primitive-load "/gnu/st?") ?).
guix system: error: exception caught while executing 'eval' on service 'root':
find-long-options: unbound variable
Installing for i386-pc platform.
/gnu/store/1dnbfda2p1bxwyl0rcm96ka9pmi0wb88-grub-2.02/sbin/grub-install: warning: disk does not exist, so falling back to partition device /dev/xvda2.
/gnu/store/1dnbfda2p1bxwyl0rcm96ka9pmi0wb88-grub-2.02/sbin/grub-install: warning: disk does not exist, so falling back to partition device /dev/xvda2.
/gnu/store/1dnbfda2p1bxwyl0rcm96ka9pmi0wb88-grub-2.02/sbin/grub-install: warning: disk does not exist, so falling back to partition device /dev/xvda2.
/gnu/store/1dnbfda2p1bxwyl0rcm96ka9pmi0wb88-grub-2.02/sbin/grub-install: error: cannot find a GRUB drive for /dev/sda.  Check your device.map.
guix system: error: failed to install bootloader /gnu/store/9iv63jm07klxvrr4fpwv6q5vpnca13ja-bootloader-installer

The final error is "normal", since I am installing in a Xen virtual machine,
where /dev/sda does not exist; it did not matter before.
The real error occurs above, the "uncaught exception".

But:
# herd status nginx
herd: service 'nginx' could not be found

Then I do a
# ./pre-inst-env guix system roll-back
# herd status nginx
herd: service 'nginx' could not be found

Otherwise said, I can go back, but my previously running web server has
definitely gone! How do I get it back?

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#30706; Package guix. (Mon, 05 Mar 2018 07:24:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: guix-devel <at> gnu.org, 30706 <at> debbugs.gnu.org
Subject: Re: bug#30706: Nginx service fails
Date: Mon, 05 Mar 2018 08:23:18 +0100
Andreas Enge <andreas <at> enge.fr> writes:

> Well, I am turning this into a bug report, since it still occurs with
> the latest git commit ac1a9ce8b07f3b80900ee08436ff6e683e8dc195 .
>
> This is the result of "./pre-inst-env guix system reconfigure ...",
> where "..." is my configuration file:
>
> ...
> creating nginx log directory '/var/log/nginx'
> creating nginx run directory '/var/run/nginx'
> creating nginx temp directories '/var/run/nginx/{client_body,proxy,fastcgi,uwsgi,scgi}_temp'
> nginx: [alert] could not open error log file: open() "/gnu/store/pp71iff1qxwhh82vm34g18h9kmn0xrg5-nginx-1.13.9/logs/error.log" failed (2: No such file or directory)
> nginx: the configuration file /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf syntax is ok
> nginx: configuration file /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf test is successful
> `/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/root' -> `/etc/ssh/authorized_keys.d/root'
> `/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/andreas' -> `/etc/ssh/authorized_keys.d/andreas'
> guix system: loading new services: user-homes term-auto nginx...
> shepherd: Evaluating user expression (register-services (primitive-load "/gnu/st?") ?).
> guix system: error: exception caught while executing 'eval' on service 'root':
> find-long-options: unbound variable

I had the same error when updating my i686 netbook after a long while.
After a reboot everything seemed to be fine, though.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Information forwarded to bug-guix <at> gnu.org:
bug#30706; Package guix. (Mon, 05 Mar 2018 07:44:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: guix-devel <at> gnu.org, 30706 <at> debbugs.gnu.org
Subject: Re: bug#30706: Nginx service fails
Date: Mon, 5 Mar 2018 08:43:24 +0100
On Mon, Mar 05, 2018 at 08:23:18AM +0100, Ricardo Wurmus wrote:
> I had the same error when updating my i686 netbook after a long while.
> After a reboot everything seemed to be fine, though.

Ah, thanks for the information! A reboot made things worse in my case -
I rebooted the virtual machine, and now I cannot ssh into it any more.
So it looks like I will have to set it up from scratch again...

In my case, the problem occurred between February 28 and March 4.

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#30706; Package guix. (Mon, 05 Mar 2018 10:10:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Andreas Enge <andreas <at> enge.fr>
Cc: guix-devel <at> gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 30706 <at> debbugs.gnu.org
Subject: Re: bug#30706: Nginx service fails
Date: Mon, 05 Mar 2018 11:09:34 +0100
Andreas Enge <andreas <at> enge.fr> skribis:

> guix system: loading new services: user-homes term-auto nginx...
> shepherd: Evaluating user expression (register-services (primitive-load "/gnu/st?") ?).
> guix system: error: exception caught while executing 'eval' on service 'root':
> find-long-options: unbound variable

The problem we have here is that the agetty service expects
‘find-long-options’ from linux-boot.scm, and it expects it at the top
level.

So what happens above is that we evaluate in PID 1 code like:

  (make <service>
    ;; …
    #:start (let ((tty … (find-long-options …) …))
               …))

If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.

Thus the whole (register-services …) expression fails to evaluate, and
we end up with some of the services missing.

Conclusions:

  1. ‘guix system reconfigure’ should probably register services one by
     one so that if one of the service expressions is erroneous, we
     don’t bork everything.  See ‘upgrade-shepherd-services’.

  2. IWBN to delay execution of this whole default-tty thing to the
     #:start method.  Ideas, Danny?

In general we should do as little as possible at the top level in the
Shepherd config file.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#30706; Package guix. (Tue, 06 Mar 2018 16:25:03 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: guix-devel <at> gnu.org, Andreas Enge <andreas <at> enge.fr>, 30706 <at> debbugs.gnu.org
Subject: Re: bug#30706: Nginx service fails
Date: Tue, 6 Mar 2018 17:24:42 +0100
[Message part 1 (text/plain, inline)]
Hi Ludo,

> If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.

How can it be that (gnu services base) with find-long-options call is present
but the (gnu build linux-boot)'s find-long options isn't present?

Aren't they either both added by "guix system reconfigure" (or both removed)?

Also when selecting an old generation in the Grub boot menu, isn't both
(gnu build linux-boot) and (gnu services base) at the same generation when
starting up the service (as opposed to stopping the old service)?

>   1. ‘guix system reconfigure’ should probably register services one by
>      one so that if one of the service expressions is erroneous, we
>      don’t bork everything.  See ‘upgrade-shepherd-services’.

Yes please.

>   2. IWBN to delay execution of this whole default-tty thing to the
>      #:start method.  Ideas, Danny?

The idea was that if you specify a serial console at boot that you can
actually log in at that console.

So it's trying to find out whether, at the time of service start,
there is a serial console specified (in the Linux command line), and if
so, start an agetty.  Otherwise do not start that agetty.

We could also do that without a guix service - but I thought it would be
nice to have a guix service for it as well.
[Message part 2 (application/pgp-signature, inline)]

Changed bug title to ''guix system reconfigure' can fail to load new system services' from 'Nginx service fails' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Thu, 08 Mar 2018 09:10:02 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Thu, 08 Mar 2018 09:10:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#30706; Package guix. (Sat, 10 Mar 2018 15:31:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: guix-devel <at> gnu.org, Andreas Enge <andreas <at> enge.fr>, 30706 <at> debbugs.gnu.org
Subject: Re: bug#30706: Nginx service fails
Date: Sat, 10 Mar 2018 16:30:15 +0100
Heya,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

>> If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.
>
> How can it be that (gnu services base) with find-long-options call is present
> but the (gnu build linux-boot)'s find-long options isn't present?

The service-upgrade code loads new service definitions in PID 1.
However, it does not force a reload of already-loaded modules.

What happens here is that (gnu build linux-boot), the one without
‘find-long-options’, is already available in PID 1.  Thus, when end up
using that one, which lacks ‘find-long-options’.

We could call ‘reload-module’, but that’s probably not a great idea as
it could cause breakage in previously-loaded code in PID 1.  So I think
the current approach is the safest, and breakage of this sort should be
quite rare; we should pay attention to such issues, though, and try hard
to avoid them.

(Note that there’s no problem once you reboot, of course.)

>>   1. ‘guix system reconfigure’ should probably register services one by
>>      one so that if one of the service expressions is erroneous, we
>>      don’t bork everything.  See ‘upgrade-shepherd-services’.
>
> Yes please.
>
>>   2. IWBN to delay execution of this whole default-tty thing to the
>>      #:start method.  Ideas, Danny?
>
> The idea was that if you specify a serial console at boot that you can
> actually log in at that console.
>
> So it's trying to find out whether, at the time of service start,
> there is a serial console specified (in the Linux command line), and if
> so, start an agetty.  Otherwise do not start that agetty.
>
> We could also do that without a guix service - but I thought it would be
> nice to have a guix service for it as well.

I agree.  I think what you did in
c32e3ddedd103318ca3f0a4bf0c91c91e2517806 is good.  The effect here is
just that agetty would fail to start upon reconfigure, but that’s an
acceptable limitation IMO.

Thanks,
Ludo’.




This bug report was last modified 6 years and 42 days ago.

Previous Next


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