Credentials ignored for git repo without leading username in URL

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Unassigned
            Reporter:
            Mark Waite
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: