Subject: guix gc: error: executing SQLite statement: database disk image is malformed

From: pkill9 <[email-masked]>
Date: Sat, 30 Dec 2023 02:25:49 +0000

Hi, I fixed this issue using sqlite3's built-in recover command:

sudo mv /var/guix/db/db.sqlite /var/guix/db/db.sqlite.bak
sqlite3 /var/guix/db/db.sqlite.bak ".recover" | sudo sqlite3 
/var/guix/db/db.sqlite

Solution was found at 
<https://stackoverflow.com/questions/18259692/how-to-recover-a-corrupt-sqlite3-database/57872238#57872238>