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

"Checkout over SSH" fails the build since it still uses HTTPS urls

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.60.2
      Cloudbees BitBucket Branch Source Plugin v. 2.2.3
    • Similar Issues:

      Description

      I've configured the option "Checkout over SSH". Yet, the HTTPS url is used, as we can see in the build log:

       

      Branch indexing
      Checking out git https://bitbucket.org/my-org/my-app-android.git into /var/jenkins_home/workspace/-app-android_avoid-os-clone-3HZZVSGHH7HARS2F37PQWWMN7OXA3M6XXBAQKXVEMDJZEPDIH6VQ@script to read Jenkinsfile
      Cloning the remote Git repository
      Cloning with configured refspecs honoured and without tags
      Cloning repository https://bitbucket.org/my-org/my-app-android.git
      > git init /var/jenkins_home/workspace/-app-android_avoid-os-clone-3HZZVSGHH7HARS2F37PQWWMN7OXA3M6XXBAQKXVEMDJZEPDIH6VQ@script # timeout=10
      Fetching upstream changes from https://bitbucket.org/my-org/my-app-android.git
      > git -version # timeout=10
      > git fetch -no-tags -progress https://bitbucket.org/my-org/my-app-android.git +refs/heads/avoid-os-clone:refs/remotes/origin/avoid-os-clone
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git fetch -no-tags -progress https://bitbucket.org/my-org/my-app-android.git +refs/heads/avoid-os-clone:refs/remotes/origin/avoid-os-clone" returned status code 128:
      stdout: 
      stderr: remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
      fatal: Authentication failed for 'https://bitbucket.org/my-org/my-app-android.git/'
      

        Attachments

          Issue Links

            Activity

            Hide
            bitwiseman Liam Newman added a comment -

            Bitbucket has been published.
            I will publish github today.

            Show
            bitwiseman Liam Newman added a comment - Bitbucket has been published. I will publish github today.
            Hide
            bitwiseman Liam Newman added a comment -

            Published 2.4.5

            Show
            bitwiseman Liam Newman added a comment - Published 2.4.5
            Hide
            java4africa Al Forbes added a comment -

            https://github.com/jenkinsci/bitbucket-branch-source-plugin/releases

            I did not find the 2.4.5 release. Are publish and release different things? If someone has time, a 2.4.5 release would be highly appreciated.

            Show
            java4africa Al Forbes added a comment - https://github.com/jenkinsci/bitbucket-branch-source-plugin/releases I did not find the 2.4.5 release. Are publish and release different things? If someone has time, a 2.4.5 release would be highly appreciated.
            Hide
            bitwiseman Liam Newman added a comment -

            Al Forbes
            2.4.5 of github branch source.
            For bitbucket, the fix is in 2.4.2.

            Show
            bitwiseman Liam Newman added a comment - Al Forbes 2.4.5 of github branch source. For bitbucket, the fix is in 2.4.2.
            Hide
            matthijsk Matthijs Kool added a comment -

            It appears this issue (or something very similar) is also present in the Gitea plugin. I have a Gitea organization configured with "Checkout over SSH" enabled. This works fine as long as Jenkins is not restarted. After a Jenkins restart, the build attempts to git clone using HTTP(s) instead of SSH. If I then click the "Scan Gitea Organization Now" button, the build again uses SSH.

            Jenkins version 2.176.1
            Gitea plugin version 1.1.2

            Show
            matthijsk Matthijs Kool added a comment - It appears this issue (or something very similar) is also present in the Gitea plugin. I have a Gitea organization configured with "Checkout over SSH" enabled. This works fine as long as Jenkins is not restarted. After a Jenkins restart, the build attempts to git clone using HTTP(s) instead of SSH. If I then click the "Scan Gitea Organization Now" button, the build again uses SSH. Jenkins version 2.176.1 Gitea plugin version 1.1.2

              People

              • Assignee:
                bitwiseman Liam Newman
                Reporter:
                elifarley Elifarley
              • Votes:
                3 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: