Svn install and import failed

Linux scm0 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.7.1908 (Core)
SubGit version 3.3.8 (‘Bobique’) build #4337
gitlab-ee.x86_64 12.3.5-ee.0.el7 @gitlab_gitlab-ee
jre1.8.x86_64 1.8.0_221-fcs @/jre-8u221-linux-x64

only thing strange i noticed when project was created through gui no user dir was present under repositories, only hashes?
[root@scm0 ~]# ls /var/opt/gitlab/git-data/repositories/
+gitaly @hashed

subgit created the user and lower dir.
[root@scm0 ~]# ls /var/opt/gitlab/git-data/repositories/hoyte
spiegel.git

-sh-4.2$ subgit configure --layout auto $SVN_PROJECT_URL $GIT_REPO_PATH
SubGit version 3.3.8 (‘Bobique’) build #4337

Configuring writable Git mirror of remote Subversion repository:
Subversion repository URL : ***
Git repository location : /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git

Detecting peg location…
Authentication realm: <***> *** DigiDoc Repositories
Peg location detected: r3102 trunk
Fetching SVN history… Done.
Growing trees… Done.
Project origin detected: r6 trunk
Building branches layouts… Done.
Combing beards… Done.
Generating SVN to Git mapping… Done.

CONFIGURATION SUCCESSFUL

To complete SubGit installation do the following:

  1. Adjust Subversion to Git branches mapping if necessary:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/config
  2. Define at least one Subversion credentials in default SubGit passwd file at:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    OR configure SSH or SSL credentials in the [auth] section of:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/config
  3. Optionally, add custom authors mapping to the authors.txt file(s) at:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/authors.txt
  4. Run SubGit ‘install’ command:
    subgit install /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git

-sh-4.2$ subgit configure --layout auto $SVN_PROJECT_URL $GIT_REPO_PATH
SubGit version 3.3.8 (‘Bobique’) build #4337

Configuring writable Git mirror of remote Subversion repository:
Subversion repository URL : ***
Git repository location : /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git

Detecting peg location…
Authentication realm: <***> *** DigiDoc Repositories
Peg location detected: r3102 trunk
Fetching SVN history… Done.
Growing trees… Done.
Project origin detected: r6 trunk
Building branches layouts… Done.
Combing beards… Done.
Generating SVN to Git mapping… Done.

CONFIGURATION SUCCESSFUL

To complete SubGit installation do the following:

  1. Adjust Subversion to Git branches mapping if necessary:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/config
  2. Define at least one Subversion credentials in default SubGit passwd file at:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    OR configure SSH or SSL credentials in the [auth] section of:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/config
  3. Optionally, add custom authors mapping to the authors.txt file(s) at:
    /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/authors.txt
  4. Run SubGit ‘install’ command:
    subgit install /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git
    -sh-4.2$ vi /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/config
    -sh-4.2$ vi /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    -sh-4.2$ ls -l /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    -rw-rw-r-- 1 git root 318 Oct 13 12:49 /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    -sh-4.2$ chmod 660 /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/passwd
    -sh-4.2$ vi /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/authors.txt
    -sh-4.2$ subgit install /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git
    SubGit version 3.3.8 (‘Bobique’) build #4337

Translating Subversion revisions to Git commits…

INSTALLATION FAILED

error: Cannot run program “git” (in directory “/var/opt/gitlab/git-data/repositories/hoyte/spiegel.git”): error=2, No such file or directory
error: error=2, No such file or directory
error: Unexpected error has occurred; please report along with the logs (’/var/opt/gitlab/git-data/repositories/hoyte/spiegel.git/subgit/subgit-install-20191013-125352.zip’)
error: to http://issues.tmatesoft.com/, thank you!

-bash-4.2$ /opt/subgit-3.3.8/bin/subgit import /var/opt/gitlab/git-data/repositories/hoyte/spiegel.git
SubGit version 3.3.8 (‘Bobique’) build #4337

Translating Subversion revisions to Git commits…

IMPORT FAILED

error: Cannot run program “git” (in directory “/var/opt/gitlab/git-data/repositories/hoyte/spiegel.git”): error=2, No such file or directory
error: error=2, No such file or directory
error: Unexpected error has occurred; please report along with the logs (’/tmp/svnkitsubgit5661936926202344264.tmp/subgit-import-20191013-131832.zip’)
error: to http://issues.tmatesoft.com/, thank you!

Hello

it looks like git is not installed on that machine and that causes the error. To resolve it, install ‘git’ program on that computer (yum install git).

It worths to take a look into it, however, as by default SubGit doesn’t need Git to be installed as SubGit can work without it. Could it be possible to collect all the logs from the spiegel.git repository (they are in subgit/logs directory), we’ll try to find out why does it try to use Git.

Thank you for the log. It looks that the error arises when SubGit tries to run Git garbage collection: by default, SubGit tries to run gc every 1000 revisions. A possible workaround is to either install git on the machine or to switch off Git gc triggering. The latter can be done by adding svn.triggerGitGC setting to the configuration:

[svn]
    …
    triggerGitGC = false

Either of those approaches will resolve the issue.

sorry, forgot to add the logs, there they are…
import works fine after installing git on the gitlab/subgit server.
only thing is that creating a project in gitlab does not create a directory in /var/opt/gitlab/git-data/repositories
i had to do:
git remote add origin https://gitlab.digi.nl/spiegel/spiegel.git
and then:
git push origin --all
for the converted project to show up in the gui.
must be my lack of knowledge/experience but might be helpful in the quick steps docs
regards,
hoyte

I’m afraid I don’t completely understand the situation: when a new project is created in GitLab UI, it creates correspondent directories .git and .wiki.git. Do you mean that your GitLab instance doesn’t create them? If so, it looks like a GitLab issue, better to reach GitLab support to investigate.
There’s also known GitLab UI issue: newly imported repositories may be shown in UI as empty. This can be resolved by the very first push or by running the following command:

gitlab-rake cache:clear

It should be ran on behalf of ‘root’.

ok ,thx4 all the help! i will contact gitlab. for now i can do the conversion so that is great! does this call autoclose?

Glad to know that the conversion works.
It doesn’t autoclose, but I’ll close it manually.

r4340 of trunk: error in “git gc” shouldn’t make SubGit stop. The errors are now logged and ignored instead.