views:

1152

answers:

4

I've got a Subversion repository, backed by the berkeley DB. Occasionally it breaks down due to some locks and such not being released, but this morning it was impossible to recover it using the 'svnadmin recover' command. Instead it failed with the following error:

svnadmin: Berkeley DB error for filesystem 'db' while opening 'nodes' table:
Invalid argument
svnadmin: bdb: file nodes (meta pgno = 0) has LSN [1083][429767].
svnadmin: bdb: end of log is [1083][354707]
svnadmin: bdb: db/nodes: unexpected file type or format

I'm going to restore the repository from the last known good backup, but it would be good to know if there is a way this repository could be fixed.

edit: even the db_recover utility does not make a difference. It shows recovery is completed, but the same error persists when verifying the repository using svnadmin.

+5  A: 

I've got a Subversion repository, backed by the berkeley DB.

Sorry to hear that. I would suggest that at your earliest convenience, you dump that repository (svnadmin dump) and reload it into a new one backed by FSFS (svnadmin load).

Greg Hewgill
While good advice, that hardly has anything to do with the question itself.
Linor
I never used a BDB repos myself, exactly because the Subversion manual warns strongly against it. So second this.
jfs
I also second this - we used to have Subversion BDB repository problems. Switching to the FSFS repository type helped.
Phill Sacre
+2  A: 

have you tried db_recover? the latter tends to be able to correct more issues than svnadmin

Owen
+1  A: 

For those wanting to try the db_recover function, you first need to find the right berkeley DB version, and then use the proper version of the berkeley DB software. Then run the recover utility:

db_recover -c -v -h <path to subversion db dir>
Linor
were you able to fix your db this way?
Owen
unfortunately not, I've restored my backup from the previous day, and lost only two minor revisions in the repository. We still had the result ofcourse, so those are now just merged together into 1 changeset.
Linor
A: 

I know this question is very old, but there is another alternative which worked for me: svnadmin recover <svn path>

yasarix