Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git repository gives 403 error while connecting from jenkins in linux

Hi I just want to configure my project from github to jenkins to generate build. I'm getting following error

Failed to connect to repository : Command "/usr/bin/git ls-remote -h 
https://github.com/xxxxx/yyyyy.git HEAD" 
returned status code 128:
stdout: 
stderr: error: The requested URL returned error: 403 Forbidden while 
accessing https://github.com/xxxxx/yyyyy.git/info/refs

fatal: HTTP request failed

enter image description here

I have added git path at Global Tool Configuration also. I've setup jenkins in linux centos server.

I have found few similar questions in stackoverflow but that doesn't give a solution

Can anyone please tell me what may be wrong in that ? Thanks in advance

like image 480
Sree Avatar asked Mar 24 '17 14:03

Sree


People also ask

How do I fix error 403 in GitHub?

There are a few possible causes for this problem: You typed an incorrect password. Make sure you are using the correct GitHub password for the account. The Git client on the A2 Hosting server requires a modified HTTPS URL to work correctly.

How do I access my GitHub repository from Jenkins?

Step 1: go to your GitHub repository and click on 'Settings'. Step 2: Click on Webhooks and then click on 'Add webhook'. Step 3: In the 'Payload URL' field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/.

How do I fix a requested URL returned error 403?

Rectifying the “403 Forbidden” Error Message There are two methods to fix the HTTPS address to resolve the 403 error in question; Method 1. Use SSH to push the changes to GitHub. First, connect to your hosting server via SSH then follow the instructions Github provides to add a remote repository.

How do I give Jenkins access to Git?

Install Jenkins Git PluginLogin to Jenkins UI using your admin account, and go to “Manage Jenkins” -> Manage Plugins -> Click on “Installed” Tab -> From here, search for “git plugin” in the filter. If the “Git plugin” is already installed, it will display it here as shown below.


1 Answers

A bit late, but this solutions works for me. Just change the URL from

 https://github.com/xxxxx/yyyyy.git

to

 https://[email protected]/xxxxx/yyyyy.git
like image 56
pedrofb Avatar answered Sep 19 '22 15:09

pedrofb