Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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><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
Answer accepted
Jeff Thomas Atlassian Team Oct 16, 2013

I ran into a similar issue when trying to connect Jenkins to our Stash repositories over HTTP (

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.

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.

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

I resolved the issue.

I follow the instructions of

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


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?

0 votes
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!

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?

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;jsessionid=684DCB09826C9A9B9183E6919BD39A38

I downloaded the jenkins today (18 oct 2013).

I installed git plugin.

I created a job with the url

the problem is that the build never finish.

I need some setup additional?


Jeff Thomas Atlassian Team Oct 17, 2013

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

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events