From fe15f991e3a65021442b682f187fcbdad06358a8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Nov 2006 11:24:10 +0000 Subject: [PATCH] * Troubleshooting information on fixing a b0rked Berkeley DB database. --- doc/manual/bugs.xml | 12 ---------- doc/manual/nix-store.xml | 2 +- doc/manual/troubleshooting.xml | 44 ++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/doc/manual/bugs.xml b/doc/manual/bugs.xml index d21603559d..aa87e4b570 100644 --- a/doc/manual/bugs.xml +++ b/doc/manual/bugs.xml @@ -15,18 +15,6 @@ generation 43 is created which is a descendant of 39, not 42. So a rollback from 43 ought to go back to 39. This is not currently implemented; generations form a linear sequence. -Build management. In principle it -is already possible to do build management using Nix (by writing -builders that perform appropriate build steps), but the Nix expression -language is not yet powerful enough to make this pleasant (?). The -language should be extended with features from the Maak build -manager. Another interesting idea is to write a -make implementation that uses Nix as a back-end to -support legacy -build files. - For security, nix-push manifests should be digitally signed, and nix-pull should verify the signatures. The actual NAR archives in the cache do not diff --git a/doc/manual/nix-store.xml b/doc/manual/nix-store.xml index 0a7ecdf067..5edc1cdaa2 100644 --- a/doc/manual/nix-store.xml +++ b/doc/manual/nix-store.xml @@ -681,7 +681,7 @@ deployment. -Operation <option>--verify</option> +Operation <option>--verify</option> Synopsis diff --git a/doc/manual/troubleshooting.xml b/doc/manual/troubleshooting.xml index 9a61205b73..c0add7fdda 100644 --- a/doc/manual/troubleshooting.xml +++ b/doc/manual/troubleshooting.xml @@ -33,6 +33,50 @@ $ rm __db.00* +
Berkeley DB gives weird error messages + +Symptom: you get error messages such as + + +Berkeley DB message: Finding last valid log LSN: file: 1 offset 28 +Berkeley DB error: file validpaths (meta pgno = 0) has LSN [483][34721]. +Berkeley DB error: end of log is [1][28] +Berkeley DB error: /nix/var/nix/db/validpaths: unexpected file type or format + +or other weird Berkeley DB errors, and they don’t away (i.e., +automatic recovery doesn’t work). This may be the case after a system crash. + +Solution: first try to run db_recover and +then nix-store +--verify: + + +$ db_recover -h /nix/var/nix/db +$ nix-store --verify + +(Make sure that you have the right version of +db_recover, namely, Berkeley DB 4.4 for Nix 0.10, +and 4.5 for Nix 0.11.) + +If that doesn’t work, it’s time to bring out the big guns: + + +$ cd /nix/var/nix +$ cp -pr db db-backup (making a backup just in case) +$ cd db +$ rm __db.* log* (removing the Berkeley DB environment) +$ mkdir tmp +$ for i in *; do db_dump $i | (cd tmp && db_load $i); done +(ignore error messages about non-database files like “reserved”) +$ mv tmp/* . +$ nix-store --verify + + + +
+ + +
Collisions in <command>nix-env</command> Symptom: when installing or upgrading, you get an error message such as