From 0ff3e3aa9bea8c82c921db88fc03cb7361b886f7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 20 Apr 2013 10:53:31 +0200 Subject: daemon: Gracefully handle cases where the daemon does not return a status code. * guix/store.scm (process-stderr): Check for EOF before doing (read-int p). --- guix/store.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/store.scm b/guix/store.scm index b1b60babf0..b82588b2a0 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -336,7 +336,10 @@ encoding conversion errors." #f)) ((= k %stderr-error) (let ((error (read-latin1-string p)) - (status (if (>= (nix-server-minor-version server) 8) + ;; Currently the daemon fails to send a status code for early + ;; errors like DB schema version mismatches, so check for EOF. + (status (if (and (>= (nix-server-minor-version server) 8) + (not (eof-object? (lookahead-u8 p)))) (read-int p) 1))) (raise (condition (&nix-protocol-error -- cgit 1.4.1