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

This widget could not be displayed.
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.

This widget could not be displayed.

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?

This widget could not be displayed.

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?

This widget could not be displayed.
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!

This widget could not be displayed.

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?

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

190 views 18 7
Join discussion

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