From: ludo@gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: 27704-done@debbugs.gnu.org
Subject: bug#27704: [PATCH] daemon: Show actual rather than collateral error when export fails.
Date: Mon, 17 Jul 2017 15:15:01 +0200 [thread overview]
Message-ID: <87r2xf8asq.fsf@gnu.org> (raw)
In-Reply-To: <87vamrbdk7.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 17 Jul 2017 11:47:04 +0200")
ludo@gnu.org (Ludovic Courtès) skribis:
> Hello,
>
> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> Having the wrong permissions on /etc/guix/signing-key.sec gives
>>
>> guix-daemon: nix/libutil/serialise.cc:15: virtual nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed.
>>
>> this patch changes that to
>>
>> guix-daemon: error: file `/etc/guix/signing-key.sec' should be secret (inaccessible to everybody else)!
>>
>> * nix/nix-daemon/nix-daemon.cc (performOp): Catch any exportPath exception,
>> report and exit on that. Fixes failing later with uninformative collateral error.
>
> Good catch!
>
>> --- a/nix/nix-daemon/nix-daemon.cc
>> +++ b/nix/nix-daemon/nix-daemon.cc
>> @@ -436,7 +436,13 @@ static void performOp(bool trusted, unsigned int clientVersion,
>> bool sign = readInt(from) == 1;
>> startWork();
>> TunnelSink sink(to);
>> - store->exportPath(path, sign, sink);
>> + try {
>> + store->exportPath(path, sign, sink);
>> + }
>> + catch (std::exception &e) {
>> + fprintf (stderr, "guix-daemon: error: %s\n", e.what ());
>> + exit (EXIT_FAILURE);
>
> I think we should simply do:
>
> sink.flush();
> throw e;
>
> in the ‘catch’ handler.
I’ve confirmed that it works as expected.
Pushed as 2e009ae7cdaee4ce871b3a79d50118762ee29fb6, thanks again!
Ludo’.
prev parent reply other threads:[~2017-07-17 13:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-15 10:58 [bug#27704] [PATCH] daemon: Show actual rather than collateral error when export fails Jan Nieuwenhuizen
2017-07-17 9:47 ` Ludovic Courtès
2017-07-17 13:15 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2xf8asq.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=27704-done@debbugs.gnu.org \
--cc=janneke@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).