Recovering a Repository

Once, after not using a repository for a while, I started getting errors like this:

   User: pronovic Group: users
   guthrie:/home/pronovic/projects/config/personal> svn update
   svn: Couldn't find a repository
   svn: No repository found in 'svn+ssh://daystrom/opt/public/svn/config/trunk/personal'
   svn: Berkeley DB error
   svn: Berkeley DB error while opening environment for filesystem /opt/public/svn/config/db:
   DB_RUNRECOVERY: Fatal error, run database recovery

Eeek!

This does look something like the error you get when the Subversion database version has been bumped (see SubversionMigrating), but I knew that wasn't the case.

Some digging on the web found me this link: http://subversion.tigris.org/project_faq.html. I scrolled down to the "Troubleshooting" section and found that I could recover the repository using this command:

   svnadmin recover /opt/public/svn/config

It's important that nothing else be accessing the database while doing this! Make sure that you change the path to match the path to the repository that got wedged (if you cut-and-paste, you might accidentally recover a repository that didn't have any problems to begin with).

Even after I ran recover, I still had an error:

   User: pronovic Group: users
   guthrie:/home/pronovic/projects/config/personal> svn update
   svn: Couldn't find a repository
   svn: No repository found in 'svn+ssh://daystrom/opt/public/svn/config/trunk/personal'
   svn: Berkeley DB error
   svn: Berkeley DB error while opening environment for filesystem /opt/public/svn/config/db:
   Permission denied

The FAQ suggested that I look over permissions after running recover. It turned out that some files were created mode 644 rather than 664 in /opt/public/svn/config/db. Opening the permissions so that the public group could read them solved the problem.

I have no idea what caused the repository to get "wedged" in the first place. What's frustrating is that it seems to happen periodically on all of my repositories, especially my repositories that are used infrequently. Very annoying, even if it is easy to fix.

Note: this no longer seems to happen after moving to FSFS repositories.

SubversionRecovering (last edited 2008-07-09 06:21:27 by localhost)