Skip to content

Commit aede7d3

Browse files
authored
Merge pull request NixOS#3 from ashgillman/patch-1
Suggestion for malformed DB that worked for me
2 parents 0d24e50 + 6ac7085 commit aede7d3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source/faq.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ Secrets?
1010
How do I fix: error: querying path in database: database disk image is malformed
1111
--------------------------------------------------------------------------------
1212

13-
No known solution yet.
13+
Try:
14+
15+
sqlite3 /nix/var/nix/db/db.sqlite "pragma integrity_check"
16+
17+
Which will print the errors in the database. If the errors are due to missing
18+
references, the following may work:
19+
20+
mv /nix/var/nix/db/db.sqlite /nix/var/nix/db/db.sqlite-bkp
21+
sqlite3 /nix/var/nix/db/db.sqlite-bkp ".dump" | sqlite3 /nix/var/nix/db/db.sqlite
1422

1523

1624
How nix decides which parts of the environment affect a derivation and its sha256 hash

0 commit comments

Comments
 (0)