Cannot connect Jenkins with GitLab (The project you were looking for could not be found or you don’t have permission)

My colleague has issue with the Jenkins. Jenkins Cannot connect to GitLab Repository, but GitLab User jenkins have permission to read this repository.

The error below here!!

Failed to connect to repository: Command "git.exe ls-remote -h <<your_git_url.git>>" HEAD return status code 128.
stdout:
stderr: remote: The project you were looking for could not be found or you don't have permission to view it
fatal: repository '<<your_git_url.git>>'

Solution

  • Change Git URL form
http://<<gitlab_url>>/<<group_name>>/<<repo_name>>.git

#### Example #### 
http://dev.ds.local/bondtrading/invest-api.git
  • To
https://<<gitlab_username>>@<<gitlab_url>>/<<group_name>>/<<repo_name>>.git

#### Example #### 
http://jenkins@dev.ds.local/bondtrading/invest-api.git
  • Run the Job and It works !!!!.

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.