upgrading a svn repository and recovering

While trying to integrate Sonar with Subversion, I had a suspicion that it wasn’t working because of either the version of the repository or a failed upgrade in the past. So on a whim*, I ran the upgrade command:

-bash-4.1$ svnadmin upgrade svn
Repository lock acquired.
Please wait; upgrading the repository may take some time…

Upgrade completed.

svn is the directory with our repository on CodeRanch. This happened almost instantaneously so I figured it was on the latest and nothing happened. Well, something happened. The permissions changed on a few files in the svn directory. I got this message:

Some of selected resources were not committed.
svn: E204900: Commit failed (details follow):
svn: E204900: Can’t open file ‘/home/vhost1/svn.javaranch.com/svn/db/txn-current-lock’: Permission denied
svn: E175002: MKACTIVITY of ‘/svn/!svn/act/bc61d1cc-5501-0010-ba7e-45a47496be2e’: 500 Internal Server Error (https://svn.javaranch.com)

Uh oh. I was able to commit before I started. Long story short, I fixed it by iterating through the errors and wound up just having to run:

chmod g+w txn-current*
 chmod g+w txn-protorevs

I tested by pulling, committing, tagging and deleting a tag. Everything seems to work.

Disclaimer

* If you work at a company, please don’t upgrade things on a whim nor allow your staff to do. I would never do that at my real job. CodeRanch operates more like the wild, wild west. Which is appropriate given the name and the fact that everything is volunteer driven and the culture is one that allows for some risk. I was able to fix this in about 15 minutes so no harm done. But if you are being paid to do something or can’t tolerate the risk, be careful. Do things on a development server. Plan. Tell people. Then these unpleasant moments where you realize you’ve made it so nobody can commit don’t happen.

Leave a Reply

Your email address will not be published.