Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-28460

Failed to connect to private bitbucket repository with username/password

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None

      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://apttusciuser@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

          [JENKINS-28460] Failed to connect to private bitbucket repository with username/password

          Spencer Rakoczy created issue -

          Dusan Susic added a comment -

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

          Dusan Susic added a comment - Still presented on git 2.3.5 and git-client 1.17.1. Jenkins 1.609.
          Mark Waite made changes -
          Link New: This issue duplicates JENKINS-26757 [ JENKINS-26757 ]
          Mark Waite made changes -
          Link New: This issue duplicates JENKINS-24368 [ JENKINS-24368 ]
          Mark Waite made changes -
          Summary Original: Failed to connect to repository in project New: Failed to connect to private bitbucket repository with username/password

          Carla Lewis added a comment -

          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

          Carla Lewis added a comment - 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 Waite made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ] New: Mark Waite [ markewaite ]

          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.

          SCM/JIRA link daemon added a comment - 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 Waite added a comment - - edited

          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://markewaite@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 git@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.

          Mark Waite added a comment - - edited 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://markewaite@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 git@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.
          Mark Waite made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            Unassigned Unassigned
            srakoczy Spencer Rakoczy
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: