I have just installed jenkins on an amazon EC2 box and i am trying to setup a job. I have installed git plugin and then i gave the url of my repo in the job's git repo field and i get the following error.
Failed to connect to repository : Command "git ls-remote -h https://[email protected]/apprick/apprickwebapp.git HEAD" returned status code 128:
stdout:
stderr: fatal: Authentication failed
The repository is a private one hosted at bitbucket and i know i should give user name and password somewhere on this git plugin but i don't see where. Attached is the screenshot as well for the reference.

I found the problem. I had to actually add my ssh keys to the bitbucket server. Basically these steps
and vola you are done.
I have had a comparable problem - like shown in the above screenshot I was entering a "connection string" to the GIT in the format: https://<user>:<password>@<URL> and receiving a "failed to connect" where the connection URL was reduced to https://<user>@<URL> - where of course was clear why it failed: The password wasn't submitted !?
After digging around I found this cause. On the environment where the problem occurred I had a newer Jenkins version (which is no issue:). But that newer Jenkins had the latest plugins 'GIT-client' version 1.4.4 and 'GIT' version 2.0 installed.
This obviously is causing a problem. Reverting to versions 1.0.7 respectively 1.5.0 (and a Jenkins restart) solved it. Keeping one of both plugins on the newer version and only downgrading the other produced another symptom: The GIT was no longer available for configuration. So there's a dependency between both plugins.
The "million-dollar-question" is: Is this a bug in those plugins? Or or do they simply need to be handled/configured differently. I didn't find any hint on this so far ..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With