GNU bug report logs - #49205
[services]: nginx doesn't restart after guix system reconfigure

Previous Next

Package: guix;

Reported by: Raghav Gururajan <rg <at> raghavgururajan.name>

Date: Thu, 24 Jun 2021 11:36:01 UTC

Severity: normal

Done: Felix Lechner <felix.lechner <at> lease-up.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49205 in the body.
You can then email your comments to 49205 AT debbugs.gnu.org in the normal way.

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#49205; Package guix. (Thu, 24 Jun 2021 11:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raghav Gururajan <rg <at> raghavgururajan.name>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 24 Jun 2021 11:36:01 GMT) Full text and rfc822 format available.

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

From: Raghav Gururajan <rg <at> raghavgururajan.name>
To: bug-guix <at> gnu.org
Subject: [services]: nginx doesn't restart after guix system reconfigure
Date: Thu, 24 Jun 2021 07:35:35 -0400
[Message part 1 (text/plain, inline)]
Hello Guix!

I am using certbot-service-type which also brings in nginx service. Upon 
`guix system reconfigure`, I get the following:

guix system: warning: exception caught while executing 'start' on 
service 'nginx':
Throw to key `%exception' with args `("#<&invoke-error program: 
\"/gnu/store/g6nhdp7i1sr51anq86hd6adrsm5ha857-nginx-1.21.0/sbin/nginx\" 
arguments: (\"-c\" 
\"/gnu/store/2igpjf27rm92np6jn6hfrxzx5m55a468-nginx.conf\" \"-p\" 
\"/var/run/nginx\") exit-status: 1 term-signal: #f stop-signal: #f>")'.

Regards,
RG.

[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#49205; Package guix. (Thu, 24 Jun 2021 18:31:01 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Raghav Gururajan <rg <at> raghavgururajan.name>
Cc: bug-guix <at> gnu.org, 49205 <at> debbugs.gnu.org
Subject: Re: bug#49205: [services]: nginx doesn't restart after guix system
 reconfigure
Date: Thu, 24 Jun 2021 20:30:21 +0200
[Message part 1 (text/plain, inline)]
Raghav Gururajan via Bug reports for GNU Guix 写道:
> Throw to key `%exception' with args `("#<&invoke-error program:
> \"/gnu/store/g6nhdp7i1sr51anq86hd6adrsm5ha857-nginx-1.21.0/sbin/nginx\" 
> arguments: (\"-c\"
> \"/gnu/store/2igpjf27rm92np6jn6hfrxzx5m55a468-nginx.conf\" 
> \"-p\" 
> \"/var/run/nginx\") exit-status: 1 term-signal: #f stop-signal: 
> #f>")'.

The shortest answer is to run this command manually and see what 
it prints out.  So

 $ sudo /gnu/store/g6n…/sbin/nginx -c /gnu/store/… -p 
 /var/run/nginx

in a terminal.

I saw you mention nginx and certbot in #guix.  It's unfortunately 
common to end up in a catch-22 with Guix's nginx and certbot 
services when using HTTP authentication, where nginx needs to be 
running to receive your first certificate but refuses to start 
because of missing certificates…

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#49205; Package guix. (Thu, 24 Jun 2021 18:31:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#49205; Package guix. (Fri, 09 Dec 2022 09:15:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: Raghav Gururajan <rg <at> raghavgururajan.name>, 49205 <at> debbugs.gnu.org
Subject: Re: bug#49205: [services]: nginx doesn't restart after guix system
 reconfigure
Date: Fri, 09 Dec 2022 10:14:38 +0100
Hi,

Tobias Geerinckx-Rice <me <at> tobias.gr> skribis:

> Raghav Gururajan via Bug reports for GNU Guix 写道:
>> Throw to key `%exception' with args `("#<&invoke-error program:
>> \"/gnu/store/g6nhdp7i1sr51anq86hd6adrsm5ha857-nginx-1.21.0/sbin/nginx\"
>> arguments: (\"-c\"
>> \"/gnu/store/2igpjf27rm92np6jn6hfrxzx5m55a468-nginx.conf\" \"-p\"
>> \"/var/run/nginx\") exit-status: 1 term-signal: #f stop-signal:
>> #f>")'.
>
> The shortest answer is to run this command manually and see what it
> prints out.  So
>
>  $ sudo /gnu/store/g6n…/sbin/nginx -c /gnu/store/… -p   /var/run/nginx
>
> in a terminal.

These days, with the Shepherd 0.9.3, the stdout/stderr or nginx is
captured in /var/log/messages when it starts.  That should make it
easier to debug startup failures.

If you don’t have more info on this bug Raghav (it’s been some time…), I
suggest we close it.

> I saw you mention nginx and certbot in #guix.  It's unfortunately
> common to end up in a catch-22 with Guix's nginx and certbot services
> when using HTTP authentication, where nginx needs to be running to
> receive your first certificate but refuses to start because of missing
> certificates…

I wonder how we could address that.

Ludo’.




Reply sent to Felix Lechner <felix.lechner <at> lease-up.com>:
You have taken responsibility. (Sun, 02 Jul 2023 02:02:02 GMT) Full text and rfc822 format available.

Notification sent to Raghav Gururajan <rg <at> raghavgururajan.name>:
bug acknowledged by developer. (Sun, 02 Jul 2023 02:02:02 GMT) Full text and rfc822 format available.

Message #19 received at 49205-done <at> debbugs.gnu.org (full text, mbox):

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: 49205-done <at> debbugs.gnu.org
Cc: Raghav Gururajan <rg <at> raghavgururajan.name>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: Closing Bug#49205: Usually caused by misconfigurations of Nginx
Date: Fri, 30 Jun 2023 19:38:18 -0700
Hi,

I have also seen this error several times. In my experience, it is
almost always caused by a misconfiguration of Nginx.

On my equipment, there is an exception to that rule when Nginx serves
outside connections as a reverse proxy to the local network, i.e.
something like: [1]

(body (list
  "proxy_pass http://lechner-desktop.us-core.com:3011;"
  "proxy_set_header Host $host;"
  "proxy_set_header X-Real-IP $remote_addr;"
  "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"))

but that's somewhat exotic. It triggers a "host not found" in the logs.

My particular failure may have to do with the service ordering in
Shepherd, although I have not been able to fix it. For example, the
default prerequisites for Nginx do not even include 'networking. [2]
Either way, Nginx is configured to respawn, so my bug is probably
elsewhere.

Closing this issue.

Kind regards
Felix

[1] https://codeberg.org/lechner/system-config/src/commit/fca07b73068b043d57930266a2102af05b0b0aa9/host/wallace-server/operating-system.scm#L892-L895
[2] https://codeberg.org/lechner/guix/src/commit/f25529b08e356f89ca7cecc44295085531a8faba/gnu/services/web.scm#L567




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 Jul 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 263 days ago.

Previous Next


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