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

Credentials ignored for git repo without leading username in URL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • git-client-plugin
    • None

      A Jenkins Freestyle job using a git plugin URL 'hostname:path' (the alternate ssh URL syntax) will fail to clone a private repository even when a credential is associated with the repository in the job definition.

      The git plugin or git client plugin seems to ignore credentials defined for ssh alternate URL's which do not include a username component.

      Steps to duplicate the problem

      1. Define an ssh private key credential for the username 'git' to a git provider (I used Assembla)
      2. Define a Freestyle job that clones from 'hostname:path'. I used git.assembla.com:git-plugin.bin.git
      3. Assign the ssh private key credential to that git repository in the Freestyle job
      4. Build the job
      5. Expected: Successful build Actual: Failed build

      If the URL is changed from git.assembla.com:git-plugin.bin.git to git@git.assembla.com:git-plugin.bin.git, the clone succeeds.

      If the URL is changed from git.assembla.com:git-plugin.bin.git to ssh://git.assembla/com:git-plugin.git, the clone succeeds.

      If the URL is changed from git.assembla.com:git-plugin.bin.git to ssh://git@git.assembla/com:git-plugin.git, the clone succeeds.

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: