[viewvc-users] "svndbadmin -v rebuild" fails with "Exception: Error adding commit: '(1048, "Column 'dirid' cannot be null")'"

Bogdan Ionescu <[email protected]> Tue, 6 Oct 2015 02:06:42 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <561364F2.3030509__15139.093498192$1444134612$gmane$org@ncct.uottawa.ca>
Hi,

While populating the ViewVC Checkin database via "svndbadmin" I got the 
following error:

*******************************************************************************
$ svndbadmin -v rebuild <my_svn_repo_path>
Purging commit info for repository root 
`/home/local/repositories/wt_eng/svn/watchtogether'
Building commit info for revision 0... skipped (no changes).
Building commit info for revision 1... skipped (no changes).
Building commit info for revision 2... done.
Building commit info for revision 3... done.

...

Building commit info for revision 1573... done.
../lib/cvsdb.py:90: Warning: Data truncated for column 'dir' at row 1
   cursor.execute(sql, sql_args)
Building commit info for revision 1574...
Traceback (most recent call last):
   File "./svndbadmin", line 376, in <module>
     main(command, repository, revs, verbose, force)
   File "./svndbadmin", line 277, in main
     handle_revision(db, command, repo, rev, verbose)
   File "./svndbadmin", line 244, in handle_revision
     db.AddCommit(commit)
   File "../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      = 2014-12-11 00:37:59
         whoid        = 15
         repositoryid = 1
         dirid        = None
         fileid       = 2519
         revision     = 1574
         stickytag    = NULL
         branchid     = 1
         addedlines   = 15
         removedlines = 0
         descid       = 1207
$
*******************************************************************************

This occurs with both ViewVC 1.1.20 and 1.1.24.
Searching the intertubes for Error adding commit: '(1048, "Column 
'dirid' cannot be null")' gave me, among many, the following: 
http://users.viewvc.tigris.narkive.com/wraIe2mP/viewvc-users-svndbadmin-crashing. 
I also found the following on the "viewvc-users" discussion list: 
http://viewvc.tigris.org/ds/viewForumSummary.do?dsForumId=4255 which has 
the following comment from cmpilato:

"Do you have a directory path in your repository that's longer than 255 
characters? If so, I think the cvsdb scheme is ill-prepared to handle it."

Checking my SVN logs, this is definitely the case, revision 1574 has 
paths longer than 255 characters. It's related to some nodejs libraries 
which have tons of nested modules that in the end give the greater than 
255 char paths. What's interesting is that the"svndbadmin update 
"$REPOS" "$REV"" in the "post-commit" svn hook passed when the 1574 
commit originally took place. So why would an "svndbadmin update" work 
but a subsequent "svndbadmin rebuild" fail on said revision? I can also 
browse this revision in ViewVC without any problems, i.e."svndbadmin 
update" must have worked on this revision since it is present in the 
ViewVC Chekin database.

Since it this seems that paths with 255+ chars is becoming the norm, 
would it be possible to add support for such a scenario? Is there 
currently a work around? Maybe a way to have the "svndbadmin rebuild" 
continue instead of stopping?

Thanks much - Bogdan.

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

To unsubscribe from this discussion, e-mail: [[email protected]].