Subject: bug#36731: shepherd lost track of nginx

From: Ludovic Courtès <[email-masked]>
Date: Mon, 22 Jul 2019 12:31:06 +0200

Hi Mark,

Mark H Weaver <[email-masked]> skribis:

> Ludovic Courtès <[email-masked]> writes:
>
>> Robert Vollmert <[email-masked]> skribis:
>>
>>> The result was this:
>>>
>>> $ sudo herd restart nginx
>>> Service nginx is not running.
>>> herd: exception caught while executing 'start' on service 'nginx':
>>> Throw to key `srfi-34' with args `("#<condition &invoke-error
>>> [program:
>>> \"/gnu/store/mlg0xfbiq03s812rm3v7mrlhyngas4xp-nginx-1.17.1/sbin/nginx\"
>>> arguments: (\"-c\"
>>> \"/gnu/store/r6gl9n7pwf4npiri05qxr40vdihdm2yy-nginx.conf\" \"-p\"
>>> \"/var/run/nginx\") exit-status: 1 term-signal: #f stop-signal: #f]
>>> 147e000>")’.
>
> […]
>
>>> That error message could also be clearer about what’s going on. At any
>>> rate, after I killed the nginx process, “herd start nginx” worked fine.
>>
>> I agree that we could and should improve the error message.
>
> On the subject of this error message, why was the &invoke-error
> condition serialized to a string before apparently being embedded within
> another exception?

That serialization comes from the Shepherd when it talks to its clients
(see ‘write-reply’ in (shepherd comm)).

Normally service methods should write a human-readable message instead
of throwing an exception, but when that happens, shepherd serializes
those things so that one can at least diagnose the problem.

In this case we could use ‘report-invoke-error’ from (guix build utils)
on ‘core-updates’.

Thanks,
Ludo’.