7

When I commit I had no error. Now I tried to check out and I got this error

Can't read length line in file 'c:\svn\db\revs\0\14'

I have tried older revision it doesn't work either. Does it mean I lost everything in subversion ?

bahrep
  • 29,961
  • 12
  • 103
  • 150
user310291
  • 36,946
  • 82
  • 271
  • 487
  • I fail to see how this is programming-related. – unwind Jan 14 '11 at 12:44
  • 1
    @unwind From [help-->What topics can I ask about here?](http://stackoverflow.com/help/on-topic) "software tools commonly used by programmers" – Richard Tingle Nov 23 '13 at 13:10
  • Great, this issue still occurs 3 years later. Luckily not on a large commercial codebase and don't have much too much lost history to worry about, so I'm tempted to start over with git. – leetNightshade Jul 08 '14 at 03:48

5 Answers5

2

You can run

svnadmin verify /var/svn/repo

to check your repository.

In case you use Berkeley db (you shouldn't),

svnadmin recover /var/svn/repo

may help.

marapet
  • 54,856
  • 12
  • 170
  • 184
1

Looks like Berkeley database have been corrupted, you should use FSFS backend next time. For now see Berkeley DB Recovery.

ismail
  • 46,010
  • 9
  • 86
  • 95
1

This seems to be SVN bug or some H/W failure. I would start looking for a backup. If you don't have one - you can commit your local working copy in new repository.

BarsMonster
  • 6,483
  • 2
  • 34
  • 47
1

I had the same problem and here is simple fix I found without administering the SVN repository.

  1. the error was produced by a specific file that I had to commit.
  2. I committed all other changed files Ok
  3. I copied the local file to the desktop as a backup
  4. SVN->Delete file
  5. commit the folder. It was successful
  6. added the file from the desktop in the local folder
  7. svn -> add, svn->commit

problem fixed. I think this way you loose the previous versions of the file from the repository but this was not a problem for me.

Hope this info can help you.

Flexo
  • 87,323
  • 22
  • 191
  • 272
Mike
  • 436
  • 5
  • 9
0

Looks like db have been corrupted for one of your revision.

So, at first you can update to previous revision and change last revision in db:

svn update -r99
vi /var/svn/site/db/current
[change number to "99"]

Than you must find out what directory is broken and replace it in repository. [corrupted] - name of your corrupted directory.

cd /var/www/site/
svn delete --keep-local [corrupted]
svn ci [corrupted] -m "Remove corrupted directory from repository"
rm -rf `find /[corrupted] -name .svn`
svn add [corrupted]
svn ci [corrupted] -m "Add fixed directory"
alexfv
  • 1,826
  • 2
  • 19
  • 22