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

Wrong username used for git clone with OpenSSH 7.7

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • git-plugin
    • None
    • Windows
      Git 2.17 (specifically) from chocolatey

      Windows VMs, Alpine Linux docker images, Debian Buster ("testing"), macOS 10.13.6, and OpenBSD 6.3 installations which use OpenSSH 7.7 (on Windows as part of Git on Windows 2.17 and Git on Windows 2.18) use the wrong username when cloning git repos with ssh (private key authentication). They're using jenkins when git is explicitly specified.

      dir("dist-utils") {
          git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
      }
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
      Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
       > git --version # timeout=10
      using GIT_SSH to set credentials Jenkins SSH RSA Key 
       > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
      ERROR: Error fetching remote repo 'origin'
      hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
      	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
      	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
      stdout: 
      stderr: jenkins@github.com: Permission denied (publickey).
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:210)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
      	at hudson.remoting.Request$2.run(Request.java:364)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at hudson.remoting.Engine$1$1.run(Engine.java:94)
      	at java.lang.Thread.run(Unknown Source)
      	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
      		at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
      		at hudson.remoting.Channel.call(Channel.java:952)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      		at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
      		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      		at java.lang.reflect.Method.invoke(Method.java:498)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      		at com.sun.proxy.$Proxy96.execute(Unknown Source)
      		at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
      		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
      		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
      		at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      		at hudson.security.ACL.impersonate(ACL.java:290)
      		at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      		at java.lang.Thread.run(Thread.java:748)

      Note, most importantly,

      stderr: jenkins@github.com: Permission denied (publickey).

      Running a git clone manually using an ssh agent works fine:

      sshagent(credentials: ['ssh-id-rsa']) {
        bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
      }

      Workarounds include:

      • Switch the username in the private key credential from the "actual user" to "git" (for example, instead of "MarkEWaite", use "git" as the credential username)
      • Switch to use username/password with https rather than a private key credential
      • Switch to use JGit as the git implementation for affected Jenkins jobs instead of command line git
      • Use a different version of OpenSSH (7.6 or earlier)

          [JENKINS-50573] Wrong username used for git clone with OpenSSH 7.7

          Joe George created issue -
          Joe George made changes -
          Description Original: Our Windows VMs which updated to the latest Git on Windows (2.17) are somehow using the wrong username when cloning git repos.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone using an ssh-agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          New: Our Windows VMs which updated to the latest Git on Windows (2.17) use the wrong username when cloning git repos. They're using {{jenkins}} when {{git}} it explicitly specified.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone using an ssh-agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          Joe George made changes -
          Description Original: Our Windows VMs which updated to the latest Git on Windows (2.17) use the wrong username when cloning git repos. They're using {{jenkins}} when {{git}} it explicitly specified.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone using an ssh-agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          New: Our Windows VMs which updated to the latest Git on Windows (2.17) use the wrong username when cloning git repos. They're using {{jenkins}} when {{git}} it explicitly specified.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone manually using an ssh-agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          Joe George made changes -
          Description Original: Our Windows VMs which updated to the latest Git on Windows (2.17) use the wrong username when cloning git repos. They're using {{jenkins}} when {{git}} it explicitly specified.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone manually using an ssh-agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          New: Our Windows VMs which updated to the latest Git on Windows (2.17) use the wrong username when cloning git repos. They're using {{jenkins}} when {{git}} it explicitly specified.
          {code:java}
          dir("dist-utils") {
              git credentialsId: 'ssh-id-rsa', url: 'ssh://git@github.com/zeroc-ice/dist-utils.git'
          }{code}
          {code:java}
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url ssh://git@github.com/zeroc-ice/dist-utils.git # timeout=10
          Fetching upstream changes from ssh://git@github.com/zeroc-ice/dist-utils.git
           > git --version # timeout=10
          using GIT_SSH to set credentials Jenkins SSH RSA Key
           > git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error fetching remote repo 'origin'
          hudson.plugins.git.GitException: Failed to fetch from ssh://git@github.com/zeroc-ice/dist-utils.git
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@github.com/zeroc-ice/dist-utils.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: jenkins@github.com: Permission denied (publickey).
          fatal: Could not read from remote repository.

          Please make sure you have the correct access rights
          and the repository exists.

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:94)
          at java.lang.Thread.run(Unknown Source)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from sal.testing.zeroc.com/192.168.90.21:58772
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
          at sun.reflect.GeneratedMethodAccessor700.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
          at com.sun.proxy.$Proxy96.execute(Unknown Source)
          at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:860)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          Note, most importantly,
          {code:java}
          stderr: jenkins@github.com: Permission denied (publickey).{code}
          Running a git clone manually using an ssh agent works fine:
          {code:java}
          sshagent(credentials: ['ssh-id-rsa']) {
            bat "git clone git@github.com:zeroc-ice/dist-utils.git dist-utils"
          }{code}
          Joe George made changes -
          Environment Original: Windows
          Git 2.17 (specifically)
          New: Windows
          Git 2.17 (specifically) from chocolatey

          Mark Waite added a comment - - edited

          I've duplicated the problem in my environment. Alternatives include:

          1. Enable JGit in your installation and configure the job to use JGit instead of command line git
          2. Use Windows command line git 2.16.2 or earlier

          Problem is specific to OpenSSH 7.7 which is included with the Windows version of git 2.17.0. The behavior of the "-l" command line argument changed in the ssh command in OpenSSH 7.7. Previously the last argument value was used and did not override the username in the connection string ("URI"). Now the first argument value is used and it overrides the username in the connection string.

          The same problem is likely visible with OpenBSD 6.3, the first version that includes OpenSSH 7.7.

          Mark Waite added a comment - - edited I've duplicated the problem in my environment. Alternatives include: Enable JGit in your installation and configure the job to use JGit instead of command line git Use Windows command line git 2.16.2 or earlier Problem is specific to OpenSSH 7.7 which is included with the Windows version of git 2.17.0. The behavior of the "-l" command line argument changed in the ssh command in OpenSSH 7.7. Previously the last argument value was used and did not override the username in the connection string ("URI"). Now the first argument value is used and it overrides the username in the connection string. The same problem is likely visible with OpenBSD 6.3, the first version that includes OpenSSH 7.7.
          Mark Waite made changes -
          Remote Link New: This issue links to "Git for Windows issue 1616 (Web Link)" [ 20373 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "OpenSSH Portable bug 2849 (Web Link)" [ 20377 ]

          Mark Waite added a comment - - edited

          OpenSSH 7.7 changed the order of evaluation of login_name. OpenSSH 7.7 is first bundled in Git for Windows 2.17.0. OpenSSH bug 2385 describes the prior order as:

          1. user specified before @ character in hostname string
          2. login_name specified using -l switch (last value wins)
          3. User option provided as a parameter to -o switch
          4. User option in matching Host block from per-user config ~/.ssh/config
          5. User option in matching Host block from systemwide config /etc/ssh/ssh_config
          If there is nothing from above specified, username on local terminal is used.

          The OpenSSH 7.7 login_name evaluation order is:

          1. login_name specified using -l switch (first value wins)
          2. user specified before @ character in hostname string
          3. User option provided as a parametr to -o switch
          4. User option in matching Host block from per-user config ~/.ssh/config
          5. User option in matching Host block from systemwide config /etc/ssh/ssh_config
            If there is nothing from above specified, username on local terminal is used.

          OpenSSH Portable bug 2849 has been submitted to track the change.

          Johannes Schindelin of the Git for Windows project has submitted a pull request to the OpenSSH Portable project.  The OpenSSH project has closed the bug report as "Won't Fix".  Damien Miller states that the behavior change is intentional.

          I'll start the work to adjust the git client plugin and/or the git plugin to adapt to the OpenSSH behavior change.

          Mark Waite added a comment - - edited OpenSSH 7.7 changed the order of evaluation of login_name. OpenSSH 7.7 is first bundled in Git for Windows 2.17.0. OpenSSH bug 2385 describes the prior order as: 1. user specified before @ character in hostname string 2. login_name specified using -l switch (last value wins) 3. User option provided as a parameter to -o switch 4. User option in matching Host block from per-user config ~/.ssh/config 5. User option in matching Host block from systemwide config /etc/ssh/ssh_config If there is nothing from above specified, username on local terminal is used. The OpenSSH 7.7 login_name evaluation order is: login_name specified using -l switch (first value wins) user specified before @ character in hostname string User option provided as a parametr to -o switch User option in matching Host block from per-user config ~/.ssh/config User option in matching Host block from systemwide config /etc/ssh/ssh_config If there is nothing from above specified, username on local terminal is used. OpenSSH Portable bug 2849 has been submitted to track the change. Johannes Schindelin of the Git for Windows project has submitted a pull request to the OpenSSH Portable project.  The OpenSSH project has closed the bug report as "Won't Fix".  Damien Miller states that the behavior change is intentional. I'll start the work to adjust the git client plugin and/or the git plugin to adapt to the OpenSSH behavior change.
          Lee Flaherty made changes -
          Attachment New: BlueOceanGeneratedKeyWorkaround.png [ 42161 ]

            markewaite Mark Waite
            externl Joe George
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: