Subgit import stopped working with Unexpected error : java.lang.ArrayIndexOutOfBoundsException

I tried to migrate svn repository to git using subgit. It stopped conversion with this error in console :

IMPORT FAILED

error:
error: Unexpected error has occurred; please report along with the logs (‘D:\svn2git\subgit-3.3.9\bin\subgit-import-20200427-202744.zip’)
error: to http://issues.tmatesoft.com/, thank you!
And I have attached the log file.

subgit-import.0.log (4.3 MB)

Hi Chaya,
thank you for reporting the issue, we are investigating it. Meanwhile, I noticed that you’re using svn protocol accessing repository on the localhost. For an SVN repository that reside on the same machine I would recommend using file protocol instead, as it would avoid the svn protocol overhead and possible errors. Could it be possible to try to perform the import once more using file protocol? The URL on WIndows machine would be:

file:///<drive letter>/<path to repository>

where should be replaced with the drive letter where the repository resides and is path to the repository.

Hi Ildar,

The SVN repo is actually on a network drive , not on local machine. So I had convert it to svn protocol using svnserve command.

Regards,
Chaya

Hi Chaya,

if the network drive is attached to the local machine, then you can use file protocol anyway.

Hi Ildar,

I tried using file protocol. But getting the below error:

error: svn: E180001: Unable to open repository ‘file:///Z:/PF_OBD_Container/subversion/repos/dde’
error: svn: E180001: Unable to connect to a repository at URL ‘file:///Z:/PF_OBD_Container/subversion/repos/dde’
error: svn: E180001: Unable to open repository ‘file:///Z:/PF_OBD_Container/subversion/repos/dde’

Please note that the network drive is mapped to local machine

Hi Chaya,

the colon should be omitted in the URL, it should be set like this:

file:///z/PF_OBD_Container/subversion/repos/dde

Hi Ildar,

I run this command :
subgit import --svn-url file:///z/PF_OBD_Container/subversion/repos/dde --authors-file …/authors.txt --trunk trunk --branches branches --tags tags dde_latest.git

And get the same error :
error: svn: E180001: Unable to open repository ‘file:///z/PF_OBD_Container/subversion/repos/dde’

Hi Chaya,

this error actually means that SubGit is unable to reach the SVN repository using given URL or the directory at the path is not an SVN repository. The latter is hardly true as it worked over svn protocol, so my assumption is that the path is not completely correct. If you have case-sensitive filesystem, then this may be the cause; or just a type somewhere, could that happen to be a reason?

in addition to my previous message: could it happen that the repository have some errors? Could you please check it running ‘svnadmin verify’ against the repository directory?

Hi Ildar,

I really appreciate the quick response.

  1. The SVN path is correct. I double checked it. In the first message of mine, I have attached a log file in which you can see that the processing was started and running and later stopped by the error.
  2. I ran the svnadmin verify command and could not see any problem with the SVN repo.

Hi Chaya,

thank you for the answers.
The issues appears to be a bug that we haven’t faced before and that we cannot reproduce. It would be very helpful for the diagnostics if you had a possibility to investigate this issue right in the repository to find out the cause and resolve it. Could you please advise if it is possible to provide us with a copy of your repository? Or at least with a dump of first 400 revisions?
Regarding the second issue – that the repository cannot be accessed over file:// protocol – this looks to be related to the fact it’s a network drive. Since the repository verification ran without errors, then the import should work normally with file:// protocol. So a possible workaround is to move the repository to a local drive and then run the import using the file protocol.
Another possible workaround is to omit the problematic revision 382. For that, add ‘–minimal-revision 385’ argument to the ‘subgit import’ command. With this option SubGit will start the import from the revision 385 thus omitting the r382 the issue occurs at.

Hello Ildar,

Thanks a ton for your support!

The problem is solved. I copied the svn repo to my local machine and tried import. This worked like a charm without any errors. As you said, the network drive communication was probably causing an overhead. You really saved my huge effort.

Thanks!

Regards,
Chaya

Hello Chaya,

It’s my pleasure! And thank for letting us know it worked.