From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWKnt-0005TZ-Kr for guix-patches@gnu.org; Sat, 15 Jul 2017 07:00:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dWKnq-0001mH-IT for guix-patches@gnu.org; Sat, 15 Jul 2017 07:00:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dWKnq-0001m8-Fo for guix-patches@gnu.org; Sat, 15 Jul 2017 07:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dWKnq-0003hL-7X for guix-patches@gnu.org; Sat, 15 Jul 2017 07:00:02 -0400 Subject: [bug#27704] [PATCH] daemon: Show actual rather than collateral error when export fails. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWKmn-0005RM-E4 for guix-patches@gnu.org; Sat, 15 Jul 2017 06:58:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dWKmk-0001Mp-Bv for guix-patches@gnu.org; Sat, 15 Jul 2017 06:58:57 -0400 From: Jan Nieuwenhuizen Date: Sat, 15 Jul 2017 12:58:51 +0200 Message-Id: <20170715105851.24979-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27704@debbugs.gnu.org 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 | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com