From 6ac70853e60daa570a3db979399735653a16deb3 Mon Sep 17 00:00:00 2001 From: Ashley Gillman Date: Tue, 18 Oct 2016 10:06:06 +1000 Subject: [PATCH] Suggestion for malformed DB that worked for me NB: I am not versed with sqlite, so this should be taken with a grain of salt. --- source/faq.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/faq.rst b/source/faq.rst index ad90c8e..aea6cb6 100644 --- a/source/faq.rst +++ b/source/faq.rst @@ -7,7 +7,15 @@ Nix How do I fix: error: querying path in database: database disk image is malformed -------------------------------------------------------------------------------- -No known solution yet. +Try: + + sqlite3 /nix/var/nix/db/db.sqlite "pragma integrity_check" + +Which will print the errors in the database. If the errors are due to missing +references, the following may work: + + mv /nix/var/nix/db/db.sqlite /nix/var/nix/db/db.sqlite-bkp + sqlite3 /nix/var/nix/db/db.sqlite-bkp ".dump" | sqlite3 /nix/var/nix/db/db.sqlite How nix decides which parts of the environment affect a derivation and its sha256 hash