[viewvc-users] svndbadmin crashing

Jean-Yves Avenard <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <BANLkTimvBt9-UvxR5Rr_timRRC0zXAbOLA__253.816755912517$1309397479$gmane$org@mail.gmail.com>
Hi there.

Rebuilding the database for our svn repository:

the svndbadmin crashes quite often:

Building commit info for revision 36691... skipped (no changes).
/usr/local/viewvc/lib/cvsdb.py:90: Warning: Data truncated for column
'dir' at row 1
  cursor.execute(sql, sql_args)
Building commit info for revision 36692...
Traceback (most recent call last):
  File "/usr/local/viewvc/bin/svndbadmin", line 364, in <module>
    main(command, repository, revs, verbose, force)
  File "/usr/local/viewvc/bin/svndbadmin", line 273, in main
    handle_revision(db, command, repo, rev, verbose, force)
  File "/usr/local/viewvc/bin/svndbadmin", line 232, in handle_revision
    db.AddCommit(commit)
  File "/usr/local/viewvc/lib/cvsdb.py", line 341, in AddCommit
    % ((str(e), ) + sql_args))
Exception: Error adding commit: '(1048, "Column 'dirid' cannot be null")'
Values were:
	type         = Add
	ci_when      = 2010-08-31 00:14:30
	whoid        = 165
	repositoryid = 25
	dirid        = None
	fileid       = 344866
	revision     = 36692
	stickytag    = NULL
	branchid     = 1
	addedlines   = 0
	removedlines = 0
	descid       = 58096

Before that one it was:

Building commit info for revision 26726...
Traceback (most recent call last):
  File "/usr/local/viewvc/bin/svndbadmin", line 364, in <module>
    main(command, repository, revs, verbose, force)
  File "/usr/local/viewvc/bin/svndbadmin", line 273, in main
    handle_revision(db, command, repo, rev, verbose, force)
  File "/usr/local/viewvc/bin/svndbadmin", line 232, in handle_revision
    db.AddCommit(commit)
  File "/usr/local/viewvc/lib/cvsdb.py", line 305, in AddCommit
    directory_id = self.GetDirectoryID(commit.GetDirectory())
  File "/usr/local/viewvc/lib/cvsdb.py", line 217, in GetDirectoryID
    return self.get_id("dirs", "dir", dir, auto_set)
  File "/usr/local/viewvc/lib/cvsdb.py", line 101, in get_id
    id = self.sql_get_id(table, column, value, auto_set)
  File "/usr/local/viewvc/lib/cvsdb.py", line 90, in sql_get_id
    cursor.execute(sql, sql_args)
  File "/usr/local/lib/python2.6/site-packages/MySQLdb/cursors.py",
line 166, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.6/site-packages/MySQLdb/connections.py",
line 35, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.IntegrityError: (1062, "Duplicate entry
'AquaDiagnostic/trunk/Development/Electronics/Design/Hardware/200' for
key 'dir'")

There's also a mistake in either the program or its description (would
be nicer if it was the program)

The inline help states:
Usage: 1. svndbadmin [-v] rebuild REPOS-PATH
       2. svndbadmin [-v] update REPOS-PATH [REV:[REV2]] [--force]
       3. svndbadmin [-v] purge REPOS-PATH

1.  Rebuild the commit database information for the repository located
    at REPOS-PATH across all revisions, after first purging
    information specific to that repository (if any).

2.  Update the commit database information for the repository located
    at REPOS-PATH across all revisions or, optionally, only for the
    specified revision REV (or revision range REV:REV2).  This is just
    like rebuilding, except that, unless --force is specified, no
    commit information will be stored for commits already present in
    the database.  If a range is specified, the revisions will be
    processed in ascending order, and you may specify "HEAD" to
    indicate "the youngest revision currently in the repository".

3.  Purge information specific to the repository located at REPOS-PATH
    from the database.

Which would indicate that REV2 is an option when doing an update:
However:
# /usr/local/viewvc/bin/svndbadmin -v update /pool/data/svn/projects 26724:
/usr/local/lib/python2.6/site-packages/MySQLdb/__init__.py:34:
DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet
ERROR: invalid revision specification "26724:"

if REV argument is in use, you must use REV2

So the program should be modified so if REV: is used, it automatically
uses HEAD.

Or the documentation needs to be changed as:
2. svndbadmin [-v] update REPOS-PATH [REV[:REV2]] [--force]
(the : was moved within the optional argument)

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2780976

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.