cvs2svn.py can't access cvs db

R

Roman Schlegel

I am trying to get my data from the cvs to the new svn repository,
both on a sparc solaris 5.8 system.
- The python package 2.3.3 is from http://sunfreeware.com
- bsddb3-4.2.4 from http://pybsddb.sourceforge.net
- Berkeley DB 4.2.52 from http://www.sleepycat.com
- Subversion 1.0.2 from http://subversion.tigris.org
- CVS 1.11

Not even a dump from an existing cvs repository works:

$ cvs2svn.py --dump-only --dumpfile test.dump /path/to/my/repos
Traceback (most recent call last):
File "cvs2svn.py", line 3211, in ?
main()
File "cvs2svn.py", line 3201, in main
ctx.default_branches_db = Database(DEFAULT_BRANCHES_DB, 'n')
File "cvs2svn.py", line 192, in __init__
self.db = anydbm.open(filename, mode)
File "/usr/local/lib/python2.3/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "/usr/local/lib/python2.3/dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
File "/usr/local/lib/python2.3/site-packages/bsddb3/__init__.py",
line 293, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE
illegal with locking specified')
....


If I run "run-tests.py", the output is as follows:

$ run-tests.py -v
CMD: cvs2svn.py <TIME = 0.916313>
PASS: run-tests.py 1: cvs2svn with no arguments shows usage
CMD: cvs2svn.py "--bdb-txn-nosync" "-s" "main-svnrepos"
"/opt/cvs2svn/test-data/main-cvsrepos" <TIME = 9.206150>

/opt/cvs2svn/cvs2svn.py said:

Traceback (most recent call last):
File "/opt/cvs2svn/cvs2svn.py", line 3211, in ?
main()
File "/opt/cvs2svn/cvs2svn.py", line 3202, in main
convert(ctx, start_pass=start_pass)
File "/opt/cvs2svn/cvs2svn.py", line 2969, in convert
_passes(ctx)
File "/opt/cvs2svn/cvs2svn.py", line 2878, in pass5
os.unlink(SVN_REVISIONS_DB)
OSError: [Errno 2] No such file or directory:
'cvs2svn-revisions.db'

FAIL: run-tests.py 3: conversion of filename with a space
....

Thanks for your input
 
R

Roman Schlegel

I found the problem. :)

[email protected] (Roman Schlegel) wrote in message news: said:
line 293, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE
illegal with locking specified')
...

This is caused by a minor version conflict of the Python Bindings
(bsddb3-4.2.4) and the Berkeley DB itself (db-4.2.52)! The change log
of Berkeley DB 4.2.52 says "9. Fix a bug to now disallow DB_TRUNCATE
on opens in locking environments, since we cannot prevent race
conditions. In the absence of locking and transactions, DB_TRUNCATE
will truncate ANY file for which the user has appropriate permissions.
[#7345]". I believe the module dbshelve.py of the pybsddb tries with
"open" in mode 'n' exactly this disallowed truncate.

There are two possible ways to solve the problem:
Solution One: Download an older Version of the Berkeley DB and install
everything again.

Solution Two (the short way): just don't use mode 'n' to open a db.
This can be avoided easily in the script cvs2svn.py at line 188:
replace the variable "mode" with the constant "'c'":

187 class Database:
188 def __init__(self, filename, 'c'): #mode):
189 self.db = anydbm.open(filename, mode)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top