Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect to repository in Jenkins to GitLab

Tags:

jenkins

gitlab

Error looks like:

Failed to connect to repository : Command "git ls-remote -h HEAD" returned status code 128: stdout: stderr: remote: HTTP Basic: Access denied fatal: Authentication failed for

like image 792
Max Power Avatar asked Jan 31 '26 21:01

Max Power


1 Answers

You are using the wrong user name and password: 1. create an API token against your username in your gitlab 2. Add the AccessToken and username in your Jenkins credentials. instead of using the username and password.

Just try out the connection: log in to the Jenkins server and try to run the command 'git ls-remote -h url'

and provide user name and AccessToken which you have created in gitlab and configured in Jenkins.

It will provide an output if the username and API matches or else it will give an error as authentication failure...

And make sure your username has access to the repository

like image 98
sri05 Avatar answered Feb 03 '26 02:02

sri05