Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn cleanup: sqlite: database disk image is malformed

I was trying to do a svn cleanup because I can't commit the changes in my working copy, and I got the following error:

sqllite: database disk image is malformed

Cleanup failed to process the following paths

What can I do right now?

like image 812
Rubens Mariuzzo Avatar asked Dec 03 '12 00:12

Rubens Mariuzzo


People also ask

How do I fix SQLite database disk image is malformed?

If you find the 'SQLite Database Disk Image is malformed' error, export your database into an SQL file. To export the data, click the File tab followed by Export>>Database to SQL file. The Export SQL dialog box appears on the screen; select the objects you want to export and define the other options.

How do I fix database disk image is malformed?

You may see the "database disk image is malformed" error in TekRADIUS log. This could happen during unplanned shutdown or reboot. The error indicates that one or more of the sqlite3 databases may have become corrupted. You need to have sqlite3.exe to diagnose and fix the problem.


2 Answers

First, open command/terminal at repository root (folder which has .svn as child folder):

cd /path/to/repository 

Download sqlite3 and put executable sqlite3 at root of folder.

You do an integrity check on the sqlite database that keeps track of the repository (/path/to/repository/.svn/wc.db):

sqlite3 .svn/wc.db "pragma integrity_check" 

That should report some errors.

Then you might be able to clean them up by doing:

sqlite3 .svn/wc.db "reindex nodes" sqlite3 .svn/wc.db "reindex pristine" 

If there are still errors after that, you still got the option to check out a fresh copy of the repository to a temporary folder and copy the .svn folder from the fresh copy to the old one. Then the old copy should work again and you can delete the temporary folder.

like image 193
HenningJ Avatar answered Sep 20 '22 12:09

HenningJ


Integrity check

sqlite3 .svn/wc.db "pragma integrity_check" 

Clean up

sqlite3 .svn/wc.db "reindex nodes" sqlite3 .svn/wc.db "reindex pristine" 

Alternatively

You may be able to dump the contents of the database that can be read to a backup file, then slurp it back into an new database file:

sqlite3 .svn/wc.db  sqlite> .mode insert sqlite> .output dump_all.sql sqlite> .dump sqlite> .exit  mv .svn/wc.db .svn/wc-corrupt.db sqlite3 .svn/wc.db  sqlite> .read dump_all.sql sqlite> .exit 
like image 20
matt burns Avatar answered Sep 20 '22 12:09

matt burns