Requesting Help Attempting To Fix Corrupt Repository

28 views
Skip to first unread message

Zach

unread,
Feb 25, 2020, 6:14:25 PM2/25/20
to TortoiseSVN

I had posted this on StackOverflow a while back, but had not gotten any responses. Was hoping someone here might have some ideas.


Last month we were working as normal with TortoiseSVN but we began to receive errors when trying to commit/update one or two specific folders that aren't commonly accessed or updated. There were a mix of "An attempt was made to set the file pointer before the beginning of the file." and "sqllite[S8]: attempt to write a readonly database." errors. A cleanup did not fix them.

We believe the issue was caused by a disk failure at some point, but due to the issues only ever occurring with these few folders, we don't have backups going far enough back to really do anything about it. We have almost 1000 more commits since that point. After some research I believe the best way to proceed is to dump all valid revisions to a new repository, and put back in files from the bad revisions after the fact.

I have followed along with the advice from this link: https://spin.atomicobject.com/2015/10/06/svn-corruption-recovery/

Below are the command line svnadmin commands I have used. D:\SVN is the location of our repository.


Check for bad revisions:

svnadmin verify D:\SVN --keep-going

Outputs the following errors:

r33809: E140001: zlib <uncompress>: corupt data: Decompression of snvdiff data failed
r34866: E720131: Can't set position pointer in file D:\SVN\db\revs\34\34866': An attempt was made to move the file pointer before the beginning of the file.
r34892: E160004: Reading one svndiff window read beyond the end of the representation.
svnadmin: E205012: Failed to verify repository 'D:\SVN'

From what I have read I cannot use svndumpfilter to exclude these bad revisions, what I would need to do is skip the bad revision and the one following it entirely when outputting to the dump file.


Based on that, here are the dumps I have created:

svnadmin dump D:\SVN -r 1:33800 > tortoisedump.txt
svnadmin dump D:\SVN -r 33801:33808 --incremental > tortoisedump33801-33808.txt

(Skipping 33809 and 33810)
svnadmin dump D:\SVN -r 33811:34808 --incremental > tortoisedump33811-34808.txt
svnadmin dump D:\SVN -r 34811:34865 --incremental > tortoisedump34811-34865.txt

(Skipping 34866 and 34867)
svnadmin dump D:\SVN -r 34868:34891 --incremental > tortoisedump34868-34891.txt

(Skipping 34892 and 34893)
svnadmin dump D:\SVN -r 34894:34997 --incremental > tortoisedump34894-34997.txt

(34998 showed as corrupt at one point, but not in my latest verify check. Excluded 34998 and 34999 for safety anyway)
svnadmin dump D:\SVN -r 35000:HEAD --incremental > tortoisedump35000-HEAD.txt

Now I create a new repository, called SVN2020

svnadmin create SVN2020

Finally, I try to load my dumps into the new repository. These run with no problems:

svnadmin load D:\SVN2020 < tortoisedump.txt 
svnadmin load D:\SVN2020 < tortoisedump33811-34808.txt

However, this is where my issues start. When I run the following:

svnadmin dump D:\SVN -r 33811:34808 > tortoisedump33811-34808.txt

I get this error, where gp_CheckInventoryTransactions_sel.sql was just a new file added in this commit

<<<Started new transaction, based on original revision 33811 
* editing path : trunk/Database/Company/Stored Procedures/gp_CheckInventoryTransactions_sel.sql 
...svnadmin: E160013: File not foundL transaction '33808-q35', path '/trunk/Database/Company/Stored Procedures/gp_CheckInventoryTransactions_sel.sql'

Does anyone have any advice on how to continue?

Thanks so much!

Thorsten Schöning

unread,
Feb 26, 2020, 2:18:10 AM2/26/20
to TortoiseSVN
Guten Tag Zach via TortoiseSVN,
am Mittwoch, 26. Februar 2020 um 00:14 schrieben Sie:

> <<<Started new transaction, based on original revision 33811
> * editing path : trunk/Database/Company/Stored
> Procedures/gp_CheckInventoryTransactions_sel.sql
> ...svnadmin: E160013: File not foundL transaction '33808-q35', path
> '/trunk/Database/Company/Stored
> Procedures/gp_CheckInventoryTransactions_sel.sql'

> Does anyone have any advice on how to continue?

I have two: As this is not TSVN-specific, you should write to and
search in the general SVN mailing lists, because they contain plenty
of cases like yours.

The second is that you most likely skipped revisions in your dumps
that added the file the error message is talking about, while later
revisions contain changes to that file. How to alter non-existing
files in the repo? SVN can't, hence the error message.

The general SVN-mailing lists contain advices how to add a revision
with that file manually, e.g. by creating such a revision file
manually or committing only that file using a SVN-client or ... I
don't remember all of those and especially no details, so you should
search the lists on your own using keywords like "svnadmin" and your
error message.

Besides that, why do you think not being able to use svndumpfilter?
The point is to NOT only exclude concrete revisions, but you need to
exclude all PATHS than belongs to files to the broken revisions as
wlel. Because no revision altering a path of excluded revision can
apply its changes anymore.

After all of that you should consider running svn admin verify or dump
regularly to check for errors. I was in the same position like you
some years ago, only with broken revisions at the end of the repo
luckily. But since then I regularly run "dump" twice a day, because at
that point "verify" contained some errors so that repo-corruption
wasn't even regonized properly.

Good luck!

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning E-Mail: Thorsten....@AM-SoFT.de
AM-SoFT IT-Systeme http://www.AM-SoFT.de/

Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Reply all
Reply to author
Forward
0 new messages