1
votes

I run my Jenkins server on the local machine, and I met problem with fetching project from GitLab repository. I don't know exactly what I have to done.

ERROR: Error cloning remote repo 'origin'

hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --tags --progress http://repository.vrpconsulting.com/roman.skaskevich/koshcheck-copy.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:

stdout:

stderr: Logon failed, use ctrl+c to cancel basic credential prompt.

remote: HTTP Basic: Access denied

fatal: Authentication failed for 'http://repository.vrpconsulting.com/roman.skaskevich/koshcheck-copy.git/'

GITLAB SETTINGS: here

EDIT #1

When I run git fetch --tags --progress http://repository.vrpconsulting.com/roman.skaskevich/koshcheck-copy.git +refs/heads/*:refs/remotes/origin/* on local machine, it performs successfully and dialog for entering login/password is showed.

But what I have to do that jenkins job performed this command successfully?

EDIT #2

For now, Credentials Binding Plugin helps me implements to checking credentials in Jenkinsfile.

EDIT #3

I run Jenkins server on another machine and have the same problem. I don't want to use login/password, so adding SSH key solved this problem.

Thanks in advance!

4

4 Answers

1
votes

Seems like your repo is private. Private git repos requires authentication. Reconfigure your git client plugin check if you are able to connect to remote repo via password based authentication , if not , try SSHing to the repo.

1
votes

Looks like this ins private repo if you want to clone that repo to jenkins workspace you need to provide your gitlab credentials in jenins.

for that, you need to install jenkins plugin called "Gitlab Authentication plugin". once you completed the installation please do a restart.

Add Gitlab credentials in "Jenkins Credentials Provider: Jenkins".

later you can add your gitlab credentials in Source Code Management

Source Code Management

in credentials select the saved gitlab credentials.

0
votes

Steps:

Install plugins: Gitlab Gitlab authentication

Configure global credentials in jenkins:

go to credentials >> system >> global creds >> username & password

ID: git username: your gitlab username password: your gitlab password

Pipeline:

stage('SCM') { steps { git credentialsId: 'git', url: 'your gitlab url' } }

0
votes

I got this error too. In my case, the git repo is a private one.

I added the git link and then supplied the git credentials to the particular Jenkins job. The issue is gone and able to build project from Jenkins.