You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Terry Smith <te...@tsmith.com> on 2005/07/09 11:07:05 UTC

DB Corruption

 
 
 
Hi, I am having a problem with corruption.  This looks like another
flavor of a regular problem.
 
First I saw this:
-------
 
C:\Documents and Settings\Terry>svnadmin recover
c:/Subversion/repository
Repository lock acquired.
Please wait; recovering the repository may take some time...
svn: DB_RUNRECOVERY: Fatal error, run database recovery
svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log of
99/1841
50
svn: bdb: Database environment corrupt; the wrong log files may have
been remove
d or incompatible database files imported from another environment
svn: bdb: strings: unable to flush page: 0
svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid
argument
svn: bdb: PANIC: Invalid argument
svn: bdb: PANIC: fatal region error detected; run recovery
svn: bdb: PANIC: fatal region error detected; run recovery
(repeated many times)
-----------
 
I web searched the string and found myself at the subversion FAQ
(surprise!).  This led me to try the db_recover tool  (I confess I have
not read extensively about this; but my hope is not to master the
Berkely DB right now).
This gave me the text below;  the output of db_recover was not
particularly verbose to me, so I may have done nothing yet.  I have good
backups, so no data is at risk, but I would like to get this working
right.
 
Additional details:  two computers are running windows XP.  Using
svnserve -d run from command line on "server."  client laptop retrieves
files in the morning; pushes them back in the evening; on weekends
server is also the client.
 
Any help is appreciated.  Thanks
 
-----------
 
C:\Subversion\repository\db>\Subversion\tools\db4-win32\bin\db_recover
-c -v -h
\Subversion\repository
db_recover: Finding last valid log LSN: file: 1 offset 28
 
C:\Subversion\repository\db>svnadmin recover c:/Subversion/repository
Repository lock acquired.
Please wait; recovering the repository may take some time...
svn: DB_RUNRECOVERY: Fatal error, run database recovery
svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log of
99/1841
50
svn: bdb: Database environment corrupt; the wrong log files may have
been remove
d or incompatible database files imported from another environment
svn: bdb: strings: unable to flush page: 0
svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid
argument
svn: bdb: PANIC: Invalid argument
svn: bdb: PANIC: fatal region error detected; run recovery
svn: bdb: PANIC: fatal region error detected; run recovery
svn: bdb: PANIC: fatal region error detected; run recovery
----------

RE: DB Corruption

Posted by Terry Smith <te...@tsmith.com>.
Max's Solution worked with no problems.

Thanks all.

-----Original Message-----
From: Max Bowsher [mailto:maxb@ukf.net] 
Sent: Sunday, July 10, 2005 9:48 AM
To: Terry Smith; users@subversion.tigris.org
Subject: Re: DB Corruption


Terry Smith wrote:
> Hi, I am having a problem with corruption.  This looks like another 
> flavor of a regular problem.
>
> First I saw this:
> -------
>
> C:\Documents and Settings\Terry>svnadmin recover 
> c:/Subversion/repository Repository lock acquired.
> Please wait; recovering the repository may take some time...
> svn: DB_RUNRECOVERY: Fatal error, run database recovery
> svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log
of
> 99/184150
> svn: bdb: Database environment corrupt; the wrong log files may have
> been remove
> d or incompatible database files imported from another environment

Bizarre. It shouldn't even be possible to get into this situation
without 
something doing some bizarre manipulation of the db files.

Anyway, here's something to try:

FIRST, MAKE A BACKUP.
Do not even consider trying out the below without first making a copy of
the 
repository.

Now, make sure you have db_dump.exe and db_load.exe available. Then, cd
to c:/Subversion/repository/db and try the following: (Omit the lines
referring to locks and lock-tokens if you are using 
Subversion 1.1.x or earlier.)

erase log.* __db.*

rename changes changes.old
rename copies copies.old
rename nodes nodes.old
rename representations representations.old
rename revisions revisions.old
rename strings strings.old
rename transactions transactions.old
rename uuids uuids.old
rename lock-tokens lock-tokens.old
rename locks locks.old

db_dump changes.old | db_load changes
db_dump copies.old | db_load copies
db_dump nodes.old | db_load nodes
db_dump representations.old | db_load representations
db_dump revisions.old | db_load revisions
db_dump strings.old | db_load strings
db_dump transactions.old | db_load transactions
db_dump uuids.old | db_load uuids
db_dump lock-tokens.old | db_load lock-tokens
db_dump locks.old | db_load locks

svnadmin recover ..
svnadmin verify ..


Max.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: DB Corruption

Posted by Max Bowsher <ma...@ukf.net>.
Terry Smith wrote:
> Hi, I am having a problem with corruption.  This looks like another
> flavor of a regular problem.
>
> First I saw this:
> -------
>
> C:\Documents and Settings\Terry>svnadmin recover
> c:/Subversion/repository
> Repository lock acquired.
> Please wait; recovering the repository may take some time...
> svn: DB_RUNRECOVERY: Fatal error, run database recovery
> svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log of
> 99/184150
> svn: bdb: Database environment corrupt; the wrong log files may have
> been remove
> d or incompatible database files imported from another environment

Bizarre. It shouldn't even be possible to get into this situation without 
something doing some bizarre manipulation of the db files.

Anyway, here's something to try:

FIRST, MAKE A BACKUP.
Do not even consider trying out the below without first making a copy of the 
repository.

Now, make sure you have db_dump.exe and db_load.exe available.
Then, cd to c:/Subversion/repository/db and try the following:
(Omit the lines referring to locks and lock-tokens if you are using 
Subversion 1.1.x or earlier.)

erase log.* __db.*

rename changes changes.old
rename copies copies.old
rename nodes nodes.old
rename representations representations.old
rename revisions revisions.old
rename strings strings.old
rename transactions transactions.old
rename uuids uuids.old
rename lock-tokens lock-tokens.old
rename locks locks.old

db_dump changes.old | db_load changes
db_dump copies.old | db_load copies
db_dump nodes.old | db_load nodes
db_dump representations.old | db_load representations
db_dump revisions.old | db_load revisions
db_dump strings.old | db_load strings
db_dump transactions.old | db_load transactions
db_dump uuids.old | db_load uuids
db_dump lock-tokens.old | db_load lock-tokens
db_dump locks.old | db_load locks

svnadmin recover ..
svnadmin verify ..


Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: DB Corruption

Posted by Terry Smith <te...@tsmith.com>.
I have not had a chance to work with Max's proposed solution; I am
unwilling to tackle it until I have a block of uninteruppted time so
that I do not get in a hurry and miss a simple point.

But in reading Branko's email, I realized I missed a point that might be
relevent.

First, to Branko's question:  This is a first time subversion install so
no upgradeshave been done.

Second, I failed to mention that I use TortiseSVN.  I doubt this is
important.  I assume it just generates command strings and is no worse
(much better) than my typing would be.

In any event, I expect to dig in and try a restore this weekend and will
reply with final resolution.

Thanks for the quick support.

Terry Smith


-----Original Message-----
From: Branko Cibej [mailto:brane@xbc.nu] 
Sent: Monday, July 11, 2005 6:56 AM
To: Terry Smith
Cc: users@subversion.tigris.org
Subject: Re: DB Corruption


Terry Smith wrote:

> Hi, I am having a problem with corruption.  This looks like another
> flavor of a regular problem.
>  
> First I saw this:
> -------
>  
> C:\Documents and Settings\Terry>svnadmin recover 
> c:/Subversion/repository Repository lock acquired. Please wait; 
> recovering the repository may take some time...
> svn: DB_RUNRECOVERY: Fatal error, run database recovery
> svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log
> of 99/1841
> 50
> svn: bdb: Database environment corrupt; the wrong log files may have 
> been remove
> d or incompatible database files imported from another environment
> svn: bdb: strings: unable to flush page: 0
> svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid 
> argument
> svn: bdb: PANIC: Invalid argument
> svn: bdb: PANIC: fatal region error detected; run recovery
> svn: bdb: PANIC: fatal region error detected; run recovery
> (repeated many times)

You don't say which version of Subversion you're using. DId you, by any 
chance, recently upgrade from 1.1.x to 1.2.x? Becaues here's what the 
1.2.0 README.txt says abou upgrading:

***** IMPORTANT *** Upgrading from 1.1.x to 1.2.x *** IMPORTANT *****

In this release, we've upgraded BerkeleyDB from version 4.2.52 to
4.3.27.  If you are currently using Subversion 1.1.x as a server on
Windows with BerkeleyDB, use the following steps to upgrade your
repositories:

  -- Make sure nobody is using the repository (stop Apache/svnserve,
     restrict access via file://).
  -- For each repository, using the old (1.1.x) binaries:
     -- Run "svnadmin recover <repos-dir>";
     -- Create a backup of the repository;
     -- Run "svnadmin list-unused-dblogs <repos-dir>"
        and remove the listed files;
     -- Delete all the "<repos-dir>\db\__db.00?" files.
  -- Upgrade Subversion.

Once again, this is only necessary for repositories based on BDB. You do
NOT have to dump/reload your repositories.

*********************************************************************


-- Brane



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: DB Corruption

Posted by Branko Čibej <br...@xbc.nu>.
Terry Smith wrote:

> Hi, I am having a problem with corruption.  This looks like another 
> flavor of a regular problem.
>  
> First I saw this:
> -------
>  
> C:\Documents and Settings\Terry>svnadmin recover c:/Subversion/repository
> Repository lock acquired.
> Please wait; recovering the repository may take some time...
> svn: DB_RUNRECOVERY: Fatal error, run database recovery
> svn: bdb: DB_ENV->log_flush: LSN of 99/206498 past current end-of-log 
> of 99/1841
> 50
> svn: bdb: Database environment corrupt; the wrong log files may have 
> been remove
> d or incompatible database files imported from another environment
> svn: bdb: strings: unable to flush page: 0
> svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid 
> argument
> svn: bdb: PANIC: Invalid argument
> svn: bdb: PANIC: fatal region error detected; run recovery
> svn: bdb: PANIC: fatal region error detected; run recovery
> (repeated many times)

You don't say which version of Subversion you're using. DId you, by any 
chance, recently upgrade from 1.1.x to 1.2.x? Becaues here's what the 
1.2.0 README.txt says abou upgrading:

***** IMPORTANT *** Upgrading from 1.1.x to 1.2.x *** IMPORTANT *****

In this release, we've upgraded BerkeleyDB from version 4.2.52 to
4.3.27.  If you are currently using Subversion 1.1.x as a server on
Windows with BerkeleyDB, use the following steps to upgrade your
repositories:

  -- Make sure nobody is using the repository (stop Apache/svnserve,
     restrict access via file://).
  -- For each repository, using the old (1.1.x) binaries:
     -- Run "svnadmin recover <repos-dir>";
     -- Create a backup of the repository;
     -- Run "svnadmin list-unused-dblogs <repos-dir>"
        and remove the listed files;
     -- Delete all the "<repos-dir>\db\__db.00?" files.
  -- Upgrade Subversion.

Once again, this is only necessary for repositories based on BDB.
You do NOT have to dump/reload your repositories.

*********************************************************************


-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org