Bitbucket + Jenkins checkout not working

SW July 17, 2017

I am using jenkins for CI stuff. I have bitbucket server installed and want to checkout the git URL (http/https) using jenkins job. I have installed Git client plugin and git plugin jenkins, versions are as follow,


Git client plugin =2.4.6
Git plugin = 3.3.2

 

When I provide the URL in job I get following error, 

bbforum.PNG

Same error when I error when I run the job.

> F:\app\Git\bin\git.exe fetch --tags --progress https://localhost:9090/scm/stcplay/mavensample.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "F:\app\Git\bin\git.exe fetch --tags --progress https://localhost:9090/scm/stcplay/mavensample.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://localhost:9090/scm/stcplay/mavensample.git/': The requested URL returned error: 403

 

Amazingly, when I do git clone invoking windows command prompt in jenkins it works perfectly.

 

Anyone faced the same issue earlier ?

 

3 answers

1 accepted

5 votes
Answer accepted
SW July 20, 2017

I solved this issue.

The problem was with Jenkins proxy settings. It was blicking Bitbucket to connect with Git plugin and hence the error was there.

I need to mention Bitbucket hostname in the non-proxy host section under manage-jenkins-->manage plugins ---> Advance settings --> non-proxy hosts.

 

And then it will allow Bitbucket host to communicate with Git plugin and you were able to checkout code successfully.

 

cheers,

Shreedhar dhanawade

Yashi Srivastava December 6, 2018

Worked for me too. Thanks ! 

anugrah_deloitte January 9, 2019

Can someone provide some details here.

 

I have hosted jenkins on a linux machine.

I am able to clone the repository but in jenkins, the same git clone command is giving issues.

 

Failed to connect to repository : Command "git ls-remote -h https://anugrah_deloitte@bitbucket.org/nvs-ssc/training.git HEAD" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://anugrah_deloitte@bitbucket.org/nvs-ssc/training.git/': Could not resolve host: bitbucket.org; Unknown error

 

Could you provide me what details did you provide in the proxy, since I have not provided any proxy details under HTTP Proxy Configuration under Advance settings

Thanks

Anugrah

Like Maha Sakka likes this
Kaidong Pei August 28, 2019

@anugrah_deloitte I have the same issue, could you please provide the way that how did you solve the issue

SW August 29, 2019

Make sure you have Bitbucket certificate imported in Jenkins cacerts.

0 votes
Maha Sakka October 9, 2019

I have the same issue also, could you please provide the way that how did you solve the issue

I need help please 
eeee.png

0 votes
Patrick Divine March 23, 2019

For me, git was not installed on the machine that was hosting Jenkins

 

This stack overflow helped me realize: https://stackoverflow.com/a/49823767/4375369

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events