You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nix-collect-garbage: error getting outputs of ... database disk image is malformed #1353
Hi,
I actually already worked around this issue (by deleting the GC root that was pulling in the problematic drvs and manually deleting these drvs, don't know if the latter was necessary). So while I don't know what this test would have done before I did that, now it does say ok.
I was hoping that simply using the backup would be good enough, but it retained the corruption. It was necessary to make a textual export and rebuild the database.
Reacted by Daniel Kahlenberg, Jonathan Ringer, hypevhs, Mrinal, Zsolt Szende, Zarak, Hirose, Kamil Monicz, Chris D'Aloisio, Andriy Novykov and 6 more
Reacted by maynard, Kasper J. Seweryn and polygonalbones
I was hoping that simply using the backup would be good enough, but it retained the corruption. It was necessary to make a textual export and rebuild the database.
At first I forgot the cd /nix/var/nix/db step before running that but that fixed it indeed.
Reacted by Claes Wallin (韋嘉誠), Marcelo Zabani, Chris D'Aloisio and Jonatan Hilmarch
This issue could be closed. I also experienced corruption but that was related to running out of disk space on /nix (future folx, make sure you check this!)
I'm still seeing this. Note that I had to change the actual .sql file produced by @573's answer. I had to remove BEGIN TRANSACTION and ROLLBACK, save the file, and then apply it. This took ages to complete, and then led me to issue 2218 which I could fix with @sondnm's solution there.
I'm also seeing this, @pmiddend I kept the BEGIN TRANSACTION and changed the ROLLBACK to COMMIT in the dumped db.sql, then sqlite3 newdb.sqlite <db.sql ran pretty fast, and after moving newdb.sqlite to the location, it seems to fix my problem.
Reacted by Joshua Leivenzon, coloursofnoise and maynard
Activity
ambrop72 commentedon Apr 22, 2017
I ran
nix-store --verify --check-contents --repairand it succeeded without finding any issue.edolstra commentedon Apr 24, 2017
Can you try
This should print
ok.ambrop72 commentedon Apr 24, 2017
Hi,
I actually already worked around this issue (by deleting the GC root that was pulling in the problematic drvs and manually deleting these drvs, don't know if the latter was necessary). So while I don't know what this test would have done before I did that, now it does say ok.
sjmackenzie commentedon Nov 23, 2018
clacke commentedon Nov 23, 2018
I'll try the solution the original reporter used -- track down the derivations responsible and evict them.
clacke commentedon Nov 23, 2018
It wasn't possible. This fixed the issue:
I was hoping that simply using the backup would be good enough, but it retained the corruption. It was necessary to make a textual export and rebuild the database.
573 commentedon Apr 4, 2019
At first I forgot the
cd /nix/var/nix/dbstep before running that but that fixed it indeed.clacke commentedon Apr 4, 2019
Oh yes! Sorry for not being explicit. Edited my previous comment to include the
cdstep.ghuntley commentedon Sep 6, 2020
This issue could be closed. I also experienced corruption but that was related to running out of disk space on
/nix(future folx, make sure you check this!)stale commentedon Mar 5, 2021
I marked this as stale due to inactivity. → More info
stale commentedon Apr 21, 2022
I closed this issue due to inactivity. → More info
pmiddend commentedon Aug 28, 2023
I'm still seeing this. Note that I had to change the actual
.sqlfile produced by @573's answer. I had to removeBEGIN TRANSACTIONandROLLBACK, save the file, and then apply it. This took ages to complete, and then led me to issue 2218 which I could fix with @sondnm's solution there.blurgyy commentedon Aug 30, 2023
I'm also seeing this, @pmiddend I kept the
BEGIN TRANSACTIONand changed theROLLBACKtoCOMMITin the dumpeddb.sql, thensqlite3 newdb.sqlite <db.sqlran pretty fast, and after movingnewdb.sqliteto the location, it seems to fix my problem.nixos-discourse commentedon Nov 23, 2023
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/an-easier-way-to-repair-corrupted-nix-db/35915/1