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.
This commit is contained in:
Ashley Gillman 2016-10-18 10:06:06 +10:00 committed by GitHub
parent 1061dfff9c
commit 6ac70853e6

View File

@ -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