Hi folks,
I recently ran into the problem that svnadmin recover failed with the
following message:
Acquiring exclusive lock on repository db.
Recovery is running, please stand by...Marc: -30981
svn: Berkeley DB error
svn: DB_RUNRECOVERY: Fatal error, run database recovery
(Note that the "Marc: -30981" part here is a debugging message by me: it is
the return value of db_err in fs.c, mentioned below)
As it turned out, this really was a permissions problem as the repository is
accessed by me and a collegue via ssh, and a .log file was missing the group
write permissions so I wasn't allowed to write to it which in turn prevented
the Berkeley db to recover the database. I have also documented this as an
enhancement request in the issue tracker, #1454
I tried to debug this and fix this, and I have come up with a patch although I
still find it very unsatisfying but believe it's better than nothing and
maybe someone of you could make a suggestion on how to improve this.
The problem is that the Berkeley db does not report what file causes the
problem, nor does it give a useful error code. While reading through the
Berkeley db code I found out that the real error is not DB_SECONDARY_BAD
(-30981, see above) but DB_NOTFOUND which is then transformen into a
DB_SECONDARY_BAD. I have not found out yet how/where/why the DB_NOTFOUND
error is produced, but it's definetely caused by missing write permissions.
Despite the error message patch I've attached there would be room to improve
the handling around line 634/639 in fs.c:
db_err = env->open (env, path_native, (DB_RECOVER | DB_CREATE
| DB_INIT_LOCK | DB_INIT_LOG
| DB_INIT_MPOOL | DB_INIT_TXN
| DB_PRIVATE),
0666);
if (db_err)
return svn_fs__bdb_dberr (db_err);
But I don't know how to check whether a permission problem caused the error
and which files to check... I guess one could check the permissions of all
files in the db/ directory of the repository, but I don't think this to be a
trivial job. Any suggestions ?
C'ya,
Marc
--
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: haisenko@webport.de
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 1 14:17:22 2003