Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We were planning migrate our svn server from debian 3.1 to 6.0 today. Before migrating some users complained about svn db corruption as below, we tried to recover using command svnadmin recover but there was not luck.

    [Wed Feb 22 23:14:30 2012] [error] Could not fetch resource information.  [500, #0]<br>
    [Wed Feb 22 23:14:30 2012] [error] Could not open the requested SVN filesystem     [500, #160029]<br>
    [Wed Feb 22 23:14:30 2012] [error] Could not open the requested SVN filesystem  [500, #160029]<br>
    [Wed Feb 22 23:14:31 2012] [error] (20014)Error string not specified yet: Berkeley DB error while opening environment or filesystem /var/svn/reponame/db:\nPermission denied

    The below error show when I tried to access from broser.

     <D:error><C:error/><m:human-readable errcode="160029">
     Could not open the requested SVN filesystem
     </m:human-readable></D:error>

Please help me to slove the issue.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

/var/svn/reponame/db: Permission denied is the issue.

What service or user is attempting to open the database? Looks like it's an Apache server - does the Apache user have rights to the repo's directory (and traverse rights on the directories leading up to it)?

Since it's a permissions issue, something's changed - what changes have been made in preparation for the migration?

share|improve this answer
    
Before migration itself the error showed, As you said yes, we are using apache2 server. user id & group id both are chown to www-data:www-data. drwxrwxr-x 7 www-data www-data 224 2011-10-03 14:10 svnrepo –  Caterpillar Feb 23 '12 at 4:03
1  
Did you check traverse permissions on the parent directories, and the db child directory (and the files within it)? The db directory is the one flagged in the error message - that'd be the first to check. –  Shane Madden Feb 23 '12 at 4:11
    
Hurray... It worked man.. Thanks a lot for help. The apache group was changed to root:root I changed to www-data:www-data recursively. It worked. Thanks a lot for the help. –  Caterpillar Feb 23 '12 at 4:50

Whilst using Berkely DB for svn is fast it can become corrupt. I have never had corruption happening when using the FSFS filesystem. And I manage quite a number of 30+ GB repositories worldwide.

That being said, I have no experience trying to fix a broken BDB svn repository, but I think in addition to looking into and possibly fixing the file permissions issues as suggested by Shane Madden, what you could try is to dump the repository and then import it in a different, empty, repository. That process may fix the corruption issues you're experiencing. It's worth a try.

Also for future reference, consider using a slave repository with live synchronisation using hook scripts. Or at least create hotcopies on a daily or hourly basis.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.