• svn: malformed file recovery

    This is how I recovered from an svn: malformed file error. Beware that this solution may not work for you, it may even result in your dog catching the flu.

    First a bit of background: In my case the repository is of the fsfs type and not the bdb type. When I first encounterd this error yesterday, i tried the standared remedies like restoring from a previous backup (svnadmin recover) to no avail. I should have known that recover is not going to work because it’s supposed to work with dbd files. Then I reckoned that the revision file in the db/revs folder may be corrupted. I was nearly right.

    The error infact turned out to be in db/revprops/122 (122 being the offending revision). The file looks like this:

    K 10
    svn:author
    V 4
    root
    K 8
    svn:date
    V 27
    2004-12-06T05:46:48.595893Z
    K 7
    svn:log
    V 52
    sftp: Added the code from the earlier work into the branch
    END
    

    the V 52 – is supposed to be the length of the comment. If you look closely you will see that the 52 does not match the number of characters on the comment line. The remedey then is to open this file in your favorite text editor and either change the V 52 to the correct value or to change the comment. That’s all.

    Thursday, February 17th, 2005 at 12:37
  • Monday, June 28th, 2010 at 11:15 | #1

    man this was a perfect post. in my case, i had edited the revprops as well, and there was blank line at the EOF. i took a look at the file after reading this, edited the file and KABLAM, this was a worthy post and glad i could find it to fix my issue.

    Regards,
    DosDawg
    Terabyte Hosting Solutions, LLC

  • Friday, July 16th, 2010 at 22:12 | #2

    Thanks for this post, I had edited my svn:ignore line in dir-props but had not changed the line character count, and this put me on the right track to fix it. Yeah!

  • Elfar
    Tuesday, July 27th, 2010 at 18:09 | #3

    Thanks for the number of characters hint, life saver :)

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TOP