404 error with Jenkins and bitbucket

When attempting to use the git plugin on jenkins to connect my bitbucket repository, i get the following error:

Failed to connect to repository : Failed to connect to https://<username>@bitbucket.org/<username>/<repo>.git (status = 404)

and of course I just copy and paste the URL into jenkins, so all the information is filled in. I have seen where other people have the same problem, but I cannot seem to ever find a fix or understand what they are saying.

If I use GitHub, it works just fine, so I am 99% sure its not my end...

So has anyone had this error and fixed it?

8 answers

1 accepted

2 votes
Jeff Thomas Atlassian Team Oct 16, 2013

I ran into a similar issue when trying to connect Jenkins to our Stash repositories over HTTP (https://answers.atlassian.com/questions/221482/jenkins-unable-to-clone-stash-repository).

I ended up using SSH and it worked. If you switch to SSH, does it work?

I have been trying for the last hour, but I cannot get past this no matter what I do:

stderr: Host key verification failed.

fatal: The remote end hung up unexpectedly

I have tried many different ways to make keys, but I am still learning linux, so I am not really sure what I am doing.

Jeff Thomas Atlassian Team Oct 16, 2013

You're following this guide for setting up your SSH key on your local machine and Bitbucket, correct?

Are you able to run the git clone command as the Jenkins user? You might be running into an issue where the bitbucket server needs to be added as a known source.

Login as the user that Jenkins is running as and try to clone your repository.

So the workaround is to switch to SSL authentication? That seems like a lot of work for something that is working fine on our other Jenkins installation.

Hello Jeff. I configure my SSH key on my local machine.

I can do git clone without problems.

I associate a deployment key a my repository according to https://confluence.atlassian.com/display/BITBUCKET/Use+deployment+keys;jsessionid=684DCB09826C9A9B9183E6919BD39A38

I downloaded the jenkins today (18 oct 2013).

I installed git plugin.

I created a job with the url

git@bitbucket.org:username/prueba.git

the problem is that the build never finish.

I need some setup additional?

Joe

Jeff Thomas Atlassian Team Oct 17, 2013

What is the error that you're getting that causes the build to not finish?

If I for jenkis 1.535 in my build configuration do check

SSH Agent, the error is:

Ejecutado por el programador

Ejecutando.en el espacio de trabajo C:\Jenkins\workspace\leiloes

[ssh-agent] Using credentials JOENET$

[ssh-agent] Looking for ssh-agent implementation...

[ssh-agent] FATAL: Could not find a suitable ssh-agent provider

[ssh-agent] Diagnostic report

FATAL: [ssh-agent] Unable to start agent

If the check is not marked the build never finish.

Jeff Thomas Atlassian Team Oct 17, 2013

Do you have the SSH Agent plugin installed in Jenkins?

0 vote
Jeff Thomas Atlassian Team Oct 23, 2013

I suspect that it is the git-plugin causing the problem. I'm currently running v1.5 and haven't tried 2.0, so you may be right!

I have the same issue now. Strangely it works from the command line as the Jenkins user (https URL, using .netrc to authenticate). We also have another Jenkins instance where it works fine, but that is using the git-plugin v2.0. Maybe the git plugin is the problem?

I resolved the issue.

I follow the instructions of https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

The tip is copy the .ssh/files to the .ssh of the account system local.

Joe

I switched to SSH and it is working now. Looks like there might be a nasty bug in 2.0.

I have been successfull getting Jenkins to work with Bitbucket via HTTPS.

I'm using Jenkins 1.548 on Windows. When testing with version 2.0 of the Git client I could not get the HTTPS URL with the user and password to work.

I upgraded to the 2.0.3 version of the Git client and it still didn't work.

The final step was to remove the user name and password from the URL and add the user name and password to the creditionals section (which is immediately after the Git URL).

This works.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Wednesday in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

174 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you