Tuesday, September 30, 2008

Found malformed header in revision file

The Problem
The client, browser, command line, etc returned the following error when attempting to access, update, check in, or any other svn command; "Found malformed header in revision file."

The apache error log contained the follow statements:
Could not fetch resource information
Could not open the root of the repository
Found malformed header in revision file.

I ran svnadmin verify repo_name and it returned the malformed header error on the last revision checked into the repository.

Solution
So here is what I ended up doing. I would like to find a way to fix the bad revision and save the check in. In the interest of time and work I chose a different solution. I am still looking into the problem and if I discover a way to fix the revision I will post again. So here it is....

svnadmin dump -r 1:lastgoodrevnumber repo_name > repo_name.dump
This dumps the content of the repository minus the bad revision. This worked for me since the bad revision number was the last revision number.

The command looks like this svnadmin dump -r 1:2742 vignette > vignette.dump

Then you need to create and load a new repository.

svnadmin create vignette_new

svnadmin load vignette_new < vignette.dump

The Beginning

Well, I said that I would start blogging and here I am. I would like this blog to be devoted to issues that I face in my professional life, not personal life. I have been thinking about this for some time and have been pushed over the edge by Subversion. Our SVN administrator has been on vacation and I have been hit with 3 difficult repository corruption issues in the last few days. As I have attempted to put together solutions for these problems I am amazed at the amount of posting that ask how to fix an error and the lack of responses to those questions.

I hope to be consistent in that if I face a problem I will describe the problem and provide a solution, work around, or at least what was done to get over through the issue and working again.