1

When we try to get gitlab to work with jenkins we keep getting the following error message under the "Respository URL" while we are sure we got the correct git repository URL.

We can acces the repository via terminal, but not with jenkins.

We have to mention that gitlab and jenkins are on the same server, but whatever we try we can't manage to get it working.

The error message:

Failed to connect to repository : Command "/usr/bin/git ls-remote -h git@git.inventief-it.nl:inventief-it/Touchless.git HEAD" returned status code 128: stdout: stderr: fatal: 'inventief-it/Touchless.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly

Any help would be really great!

mitkosoft
  • 5,262
  • 1
  • 13
  • 31
Codinz
  • 11
  • 2
  • 1
    What did you enter under the "Repository URL in Jenkins? Do you use the Gitlab plugin? Are you trying to access it using HTTPS or SSH? If HTTPS, is the repository correctly configured for cloning the repo without credentials? If SSH, have you tried using the same credentials over SSH? – Cronax Mar 08 '16 at 14:58

1 Answers1

1

I am also facing the same issue i resolved this issue using following steps please try may be it helps if you also have the same issue. As i cannot comment due to so i just suppose that you have a valid git url and you are able to push/pull from that git repo.i resolved this issue with following steps.

  • First i came to know that Git plugin is not working in Jenkins so you need to use JGit.
  • Secondly i generate ssh key for jenkins and add this key to the account user which i want to mention in git repo section of jenkins.
  • Last step i add that key in Gitlab. If you add Deploy key in gitlab than jenkins can have access to the git repo using the ssh key which you generated previously.Make sure the Deploy key for is enabled for jenkins in Gitlab.

    Few screen shots are attached for your help

jenkins ssh key adding with user

Deploy key in Gitlab

Bill
  • 91
  • 2