Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins failed to connect to remote bit bucket repository

I am using jenkins and trying to connect to the bit bucket remote repository for that I provide the bit bucket URL in source code management in git repositories, I create the credentials also for that bit bucket account added in the credentials

I tried the below in git repositories

https://[email protected]/gsmohan/quickride.git

But it gives the error below specified:

ERROR:Failed to connect to repository : Failed to connect to https://[email protected]/gsmohan/quickride.git using credentials bitbucket account (status = 401)

Can anyone please help to me?

like image 428
user3619128 Avatar asked Jun 11 '14 06:06

user3619128


People also ask

How do I fix Jenkins failed to connect to repository?

You might need to set the path to your git executable in Manage Jenkins -> Configure System -> Git -> Git Installations -> Path to Git executable.

How do you add Jenkins SSH key to Bitbucket?

Add the public key to your Account settingsOpen your .ssh/id_rsa.pub file (or whatever you named the public key file) and copy its contents. You may see an email address on the last line. It doesn't matter whether or not you include the email address. From Bitbucket, click Add key.


2 Answers

Change repository address to this format:

https://user:[email protected]/user/project_name.git

And of course:

  • user - your bitbucket user,
  • password- your bitbucket password,
  • project_name - name of project/repo,
like image 162
tostao Avatar answered Oct 12 '22 13:10

tostao


In Jenkins ver. 2.6 just use

https://[email protected]/user/project_name.git 

And add your credentials.

enter image description here Important: Make sure that your git installed version is greater or equals than 1.7.4 because of the --local issue.

If you are on CentOS maybe you face the same problem than me. Here is a great answer from @AmirHd to upgrade git version on CentOS, if you already have git installed just type:

yum --disablerepo=base,updates --enablerepo=rpmforge-extras update git

Hope this helps!!!

like image 45
Gueorgui Obregon Avatar answered Oct 12 '22 13:10

Gueorgui Obregon