SVN files are not moved to GitLab

I want to move my SVN repository into GitLab through SubGit. I have followed the step of SubGit and got the following output:

Amits-MacBook-Pro:bin amitraj$ ./subgit install $GIT_REPO_PATH
SubGit version 3.3.10 (‘Bobique’) build #4368

Translating Subversion revisions to Git commits…

Subversion revisions translated: 563.
Total time: 215 seconds.

INSTALLATION SUCCESSFUL

You are using SubGit in evaluation mode.
Your evaluation period expires on August 4, 2020 (in 7 days).

Extend your trial or purchase a license key at https://subgit.com/pricing

But the files are not moved to GitLab. I also asked for subgit license file but I also have not received it yet. I filled the required form 28 July 2020.

Hello Amit,

could you please advise how did you find that the files were not moved to GitLab: namely, did you make this conclusion just by that you see in the GitLab UI or had you tried to clone the repository and files were not there? If the former case this is just GitLab UI issue, this condition can be cleared by the following command:

gitlab-rake cache:clear

it will clear the UI cache so the new files in the repository will appear in the UI.

If you have cloned repository and don’t see your files from SVN, then most probably your mapping configuration used for the import was not correct; this case will require a deeper investigation to resolve. For that, please collect and send us SubGit logs from the repository (they reside in /subgit/logs directory) – send us all the files that reside in that directory. Besides, please describe your SVN repository layout and what exactly from SVN you need to import to Git.

I tried to send you an email with the license key, but it looks like your mail server does not allows email from our domain. Please let me know another address I could sent the key to.

Thanks for your response. I am the same guy who has opened this ticket. I have sign-up with the same email-id but still did not get the email verification mail. So I have used a different id. You can send me the license file on ‘abhiamitraj@gmail.com’.

Please let me know where should I run the following command:

gitlab-rake cache:clear

Please find the following trace files related to it:
subgit-import-20200730-182456.zip (6.8 KB)

Besides, please describe your SVN repository layout and what exactly from SVN you need to import to Git.
There is one repository in which there are multiple folder and sub-folders are there. I need to move whole repository to GitLab.

Other trace files are as follows:
subgit-install-20200730-182022.zip (8.7 KB)
daemon.0.log (4.6 MB)

Other trace files are as follows:
subgit-configure-20200730-181431.zip (3.0 KB)
subgit-configure-20200730-181520.zip (2.3 KB)

The command
gitlab-rake cache:clear
should be run anywhere in the console. The only thing to take into account is that one has to run this command on behalf of ‘root’ system user.

If this doesn’t help, could you explain what you mean

the files are not moved to GitLab

i.e. what do you do to check whether the files are moved, what do you expect to see and what do you see instead?

This “gitlab-rake” command should fix GitLab UI if it’s only UI caches which is the issue.

Also I’ve looked into the logs attached, there’re exceptions:

Caused by: java.io.IOException: There was a problem while connecting to 192.168.7.46:22
at com.trilead.ssh2.Connection.connect(Connection.java:817)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:225)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)

and

Caused by: java.io.IOException: Password authentication failed.
        at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:369)
        at com.trilead.ssh2.Connection.authenticateWithPassword(Connection.java:345)
        at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:249)
        at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
        at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
        at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)

So there were issues with network connection to the SVN repository (“Host is down” error) and password authentication to SVN. Have you resolved those issues?

After looking at “subgit-install.0.log” you’ve attached I think I’ve found out why you see no files. This is because by default SubGit expects trunk/branches/tags structure for the URL you specify.

This is the best article to about your case
https://subgit.com/documentation/branches-mapping.html

I guess that chapter 5.1 Single Directory describes your situation. This corresponds to

subgit configure --svn-url svn+ssh://amitraj@192.168.7.46/home/svn/svn/language --layout directory path/to/repo.git

call. Unfortunately this option cannot be changed on the fly, so you have to do that from scratch (i.e. on a new empty repository without SubGit).

Thanks for your response. I am able to move my whole SVN repository into the GitLab. I am also able to register the provided license file. I just want to make sure that I have followed the correct steps. First I ran the following commands in the ‘subgit-3.3.10/bin’ directory:

./subgit configure --layout directory $SVN_PROJECT_URL $GIT_REPO_PATH
./subgit install $GIT_REPO_PATH

Then I ran the following command after putting the subgit license file in the ‘language.git/subgit/’ directory

sudo ./subgit register --key …/language.git/subgit/subgit.key …/language.git

Then I ran the following commands in the ‘language.git’ directory:

git remote add origin …/language.git
git push -u origin master

I have made some changes and commit in SVN repository. Then I ran the following command in the ‘subgit-3.3.10/bin’ directory:

./subgit import $GIT_REPO_PATH

After that I ran the following command in the ‘language.git’ directory:

git push -u origin master

Now I have 2 queries regarding this mirroring which are as follows:
I saw that when I updated the SVN repository, the GitLab repository is also updated after running two commands.
1. How can I do the same from the GitLab repository to the SVN repository means when I update the GitLab repository first and SubGit will update the SVN repository?
2. Can this mirroring be done automatically means without running any command (subgit import and git push)?

Thanks for your support in advance.

Everything you wrote until “subgit import” was correct. But you never need “subgit import” because “subgit import” is just for one time SVN->Git conversion, not for continuous synchronization.

Actually after “subgit install” you don’t need any command at all. Here’s why.

If you push to the Git repository, ‘pre-receive’ hook is automatically triggered and it sends to SubGit daemon a command to synchronize the change you’ve just pushed to SVN. No special command is required. If SubGit daemon is not running (e.g. if you restarted the server), the ‘pre-receive’ hook will start it and the daemon will stay in the background.

If you commit to SVN, SubGit doesn’t receives any notification automatically but SubGit daemon (if it’s running) checks for new changes in SVN once a minute (svn.fetchInterval option regulates this). So no special command is necessary again.

The only thing to do is to make sure SubGit daemon is running. You can always check it using ‘jps’ command which is provided together Java distribution.
$ jps | grep SubGitDaemon
12787 SubGitDaemon
This command (as well as SubGit daemon itself) should be run on behalf of ‘git’ system user (i.e. the same user as GitLab uses).

When you run ‘subgit install’, it starts the daemon automatically, so unless you restart the server. If you restart the server, it’s enough to either push to the Git repository to start SubGit daemon. If you have nothing to push, you can use this command

git push -q origin --delete refs/subgit/command/fetch

OR

git push -q $FULL_GIT_URL --delete refs/subgit/command/fetch

It’s a command to delete an artificial non-existing branch. This will trigger ‘pre-receive’ hook, which will start SubGit daemon. The daemon will interpret this as a command to perform SVN<->Git synchronization immediately.

Finally, you can use ‘subgit fetch’ command (on behalf of ‘git’ system user) for starting SubGit daemon after restarting the server. It also just starts SubGit daemon and performs SVN<->Git synchronization.

There’s a number of other ways to configure SubGit but the easiest thing to do is just to do nothing. If you push to the Git repository more or less regularly, you don’t have to worry about SubGit daemon.

So my answers to your questions are:
1. How can I do the same from the GitLab repository to the SVN repository means when I update the GitLab repository first and SubGit will update the SVN repository?
Just push to GitLab, this will trigger ‘pre-receive’ hook, which will tell the daemon to perform synchronization. Even if you change GitLab somehow without triggering the hook, wait a minute, and the synchronization will be performed automatically. If you don’t want to wait, push something to GitLab, e.g. a deletion of a non-existing branch.

2. Can this mirroring be done automatically means without running any command (subgit import and git push)?
Yes, this is already performed automatically in both directions, you never need to run “subgit import”.