From: Jan Nieuwenhuizen <janneke@gnu.org>
To: 27704@debbugs.gnu.org
Subject: [bug#27704] [PATCH] daemon: Show actual rather than collateral error when export fails.
Date: Sat, 15 Jul 2017 12:58:51 +0200 [thread overview]
Message-ID: <20170715105851.24979-1-janneke@gnu.org> (raw)
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.
---
nix/nix-daemon/nix-daemon.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index 7d26b6135..aeeadf144 100644
--- 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);
+ }
sink.flush();
stopWork();
writeInt(1, to);
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
next reply other threads:[~2017-07-15 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-15 10:58 Jan Nieuwenhuizen [this message]
2017-07-17 9:47 ` [bug#27704] [PATCH] daemon: Show actual rather than collateral error when export fails Ludovic Courtès
2017-07-17 13:15 ` bug#27704: " Ludovic Courtès
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=20170715105851.24979-1-janneke@gnu.org \
--to=janneke@gnu.org \
--cc=27704@debbugs.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).