[JIRA] [git-plugin] (JENKINS-28460) Failed to connect to repository in project

1,679 views
Skip to first unread message

srakoczy@apttus.com (JIRA)

unread,
May 18, 2015, 1:34:02 PM5/18/15
to jenkinsc...@googlegroups.com
Spencer Rakoczy created an issue
 
Jenkins / Bug JENKINS-28460
Failed to connect to repository in project
Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: git-plugin
Created: 18/May/15 5:33 PM
Priority: Major Major
Reporter: Spencer Rakoczy

Git plugin version 2.3.5, jenkins version 1.613.
When trying to link the job with my GIT repository (i am using bitbucket) , I am getting this red error message:
Failed to connect to repository : Could not init C:\Users\<username>\AppData\Local\Temp\hudson6773377567759656092tmp

This is interesting because I can successfully clone this repository from git bash. The project uses login credentials rather than SSH keys.
The git.exe ls-remote <repo url> command also works correctly from git bash.
I believe i have my permissions set correctly, all the online forums i have looked at have been no help, many have said it must be a bug with the git plugin.

Here is the info on the failed build when i try to build the project in jenkins.

Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\CPQ-core-practice
Cloning the remote Git repository
Cloning repository https://apttus...@bitbucket.org/apttusciuser/cpq-core.git
> C:\Users\<user>y\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin init C:\Program Files (x86)\Jenkins\workspace\<projectname> # timeout=10
ERROR: Error cloning remote repo 'origin'
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

d.susic@levi9.com (JIRA)

unread,
May 20, 2015, 7:33:01 AM5/20/15
to jenkinsc...@googlegroups.com
Dusan Susic commented on Bug JENKINS-28460
 
Re: Failed to connect to repository in project

Still presented on git 2.3.5 and git-client 1.17.1. Jenkins 1.609.

mark.earl.waite@gmail.com (JIRA)

unread,
Jun 19, 2015, 7:20:03 PM6/19/15
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Failed to connect to private bitbucket repository with username/password
Change By: Mark Waite
Summary: Failed to connect to  private bitbucket  repository  in project  with username/password

clewis233@comcast.net (JIRA)

unread,
Jun 24, 2015, 4:27:02 PM6/24/15
to jenkinsc...@googlegroups.com
Carla Lewis commented on Bug JENKINS-28460
 
Re: Failed to connect to private bitbucket repository with username/password

I am also receiving this error git plugin version 1.68 Jenkins version 1.617.

I can see this error when configuring the job
Failed to connect to repository : Could not init C:\Windows\TEMP\hudson1802685872087768658tmp

Also when running the job: > C:\Program Files (x86)\Git\bin init C:\Program Files (x86)\Jenkins\jobs\WebServices\workspace # timeout=10


ERROR: Error cloning remote repo 'origin'
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 25, 2015, 8:52:07 AM7/25/15
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Mark Waite
 
Change By: Mark Waite
Assignee: Nicolas De Loof Mark Waite

scm_issue_link@java.net (JIRA)

unread,
Jul 25, 2015, 7:04:04 PM7/25/15
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-28460
 
Re: Failed to connect to private bitbucket repository with username/password

Code changed in jenkins
User: Mark Waite
Path:
src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java
http://jenkins-ci.org/commit/git-client-plugin/ff9c219277531dcf0f18dccd6d8665118e1827a3
Log:
Add username/password support to CredentialsTest

Help test JENKINS-26757, JENKINS-24368 and JENKINS-28460.

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 25, 2015, 10:29:02 PM7/25/15
to jenkinsc...@googlegroups.com
Mark Waite resolved as Fixed
 

A fix from Jacob Keller for

JENKINS-29604 in the latest git-client-plugin 1.18.1 pre-release has fixed this so that a username / password credential works correctly with a bitbucket private https URL like https://marke...@bitbucket.org/markewaite/bin.git.

A username / password credential does not yet work with a bitbucket private URL when that URL is using the ssh protocol, like g...@bitbucket.org:markewaite/bin.git .

Change By: Mark Waite
Status: Open Resolved
Resolution: Fixed

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 29, 2015, 7:39:04 AM7/29/15
to jenkinsc...@googlegroups.com
Mark Waite reopened an issue
 

Thanks for checking. I had run that test interactively and thought it worked. An automated test is definitely working in my test harness. Unfortunately, when I just attempted the same thing from a fresh docker instance of Jenkins using https://username:pass...@bitbucket.org/username/private-repo.git, it failed. I then used the same repository URL from command line git and confirmed it works correctly.

The automated test must not be matching the real world closely enough. I'll explore further as time allows.

Change By: Mark Waite
Resolution: Fixed
Status: Resolved Reopened

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 8, 2015, 5:56:04 PM10/8/15
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Aug 30, 2016, 7:11:01 AM8/30/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-28460
 
Re: Failed to connect to private bitbucket repository with username/password
A fix from Jacob Keller for JENKINS-29604 in the latest [git-client-plugin 1.18.1 pre-release|https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/728/org.jenkins-ci.plugins$git-client/artifact/org.jenkins-ci.plugins/git-client/1.18.1-SNAPSHOT/git-client-1.18.1-SNAPSHOT.hpi] has fixed this so that a username / password credential works correctly with a bitbucket private https URL like https://marke...@bitbucket.org/markewaite/bin.git.

A username / password credential does not yet work with a bitbucket private URL when that URL is using the ssh protocol, like g...@bitbucket.org:markewaite/bin.git .
  In order to use ssh protocol with the git protocol, a private key credential is required, rather than a username / password credential.
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

james@howeswho.co.uk (JIRA)

unread,
Sep 13, 2018, 10:10:15 AM9/13/18
to jenkinsc...@googlegroups.com
James Howe resolved as Fixed
 
Change By: James Howe
Status: Reopened Resolved
Resolution: Fixed
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

james@howeswho.co.uk (JIRA)

unread,
Sep 13, 2018, 10:10:15 AM9/13/18
to jenkinsc...@googlegroups.com
James Howe commented on Bug JENKINS-28460
 
Re: Failed to connect to private bitbucket repository with username/password

This seems to work fine now. Just add the URL e.g. https://bitbucket.org/owner/repo.git and select a username+password credential.

Jenkins 2.138.1, Git client plugin 2.7.3, Git plugin 3.9.1, Credentials Plugin 2.1.18

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 13, 2018, 12:25:03 PM9/13/18
to jenkinsc...@googlegroups.com

Thanks James Howe! The specific case that was failing for me did not use a Jenkins credential. It embedded the username and password into the URL as in:

I suspect that case may still be broken. I believe it is a largely irrelevant case, but it was not well-behaved the last time I checked (3 years ago). I have a test in my regression kit that is known to fail with that case. I haven't run that known failure test in quite a while.

james@howeswho.co.uk (JIRA)

unread,
Sep 13, 2018, 12:37:02 PM9/13/18
to jenkinsc...@googlegroups.com

Mark Waite no, that works too AFAICT. Though obviously not a great way to do it, as your password is then in plaintext all over the place.

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 13, 2018, 12:39:03 PM9/13/18
to jenkinsc...@googlegroups.com

Thanks James Howe, that is good news. I can enable that in my regression tests and it should pass.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 22, 2019, 9:32:24 PM10/22/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
 
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages