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

fatal: ssh variant 'simple' does not support setting port

    Details

    • Similar Issues:

      Description

      Current git-client-plugin does not work with latest git release 2.16 and non-standard ssh ports

      [Pipeline] checkout
      Cloning the remote Git repository
      Cloning with configured refspecs honoured and without tags
      Cloning repository ssh://git@host:7999/project/repo.git
       > git init /jenkins/workspace/repo_develop-DGGZOGIPSH34PO2EDJ254373MVQP6J2NDVXNIMFMFC6GWPEKUVAQ # timeout=10
      Fetching upstream changes from ssh://git@host:7999/project/repo.git
       > git --version # timeout=10
      using GIT_SSH to set credentials ssh-key
       > git fetch --no-tags --progress ssh://git@host:7999/project/repo.git +refs/heads/develop:refs/remotes/origin/develop
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git fetch --no-tags --progress ssh://git@host:7999/project/repo.git +refs/heads/develop:refs/remotes/origin/develop" returned status code 128:
      stdout: 
      stderr: fatal: ssh variant 'simple' does not support setting port
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1990)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1709)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:400)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:609)
      	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:358)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	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)
      	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to eap0035
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1696)
      		at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
      		at hudson.remoting.Channel.call(Channel.java:909)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      		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.$Proxy107.execute(Unknown Source)
      		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1120)
      		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:274)
      		at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      		... 4 more

       Steps to reproduce, create a ssh.sh wrapper file (like it will be done during createUnixGitSSH)

      #!/bin/sh
      // ${SSH_ASKPASS} might be ignored if ${DISPLAY} is not set
      if [ -z "${DISPLAY}" ]; then
      DISPLAY=:123.456
      export DISPLAY
      fi
      ssh -i ~/key -l ${USER} -o StrictHostKeyChecking=no "$@"
      

      Export GIT_SSH variable

      export GIT_SSH=~/ssh.sh
      

      Test a git call (with 2.16)

      git fetch --no-tags --progress ssh://git@<host>:7999/project/repo.git +refs/heads/develop:refs/remotes/origin/develop
      fatal: ssh variant 'simple' does not support setting port
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          I can't duplicate this failure with any version of command line git on any of the platforms I test. I regularly use non-default ssh ports in an ssh URL to a git repository and it works as expected.

          I've added a test for this to my private regression test suite.

          Can you explore further to identify what's different between your failing installation and my installation that works as expected?

          There is a reference to "ssh variant 'simple'" on the git mailing list. If that pull request has been merged, then it indicates you've somehow selected a variant of SSH which does not support port specification. SInce you need port specification, you'll need to reinstall or reconfigure command line git to have the complete SSH implementation, rather than the simple ssh implementation.

          As far as I can tell, this is not a git plugin or a git client plugin bug. It is a configuration error in command line git, or a bug in command line git.

          Show
          markewaite Mark Waite added a comment - I can't duplicate this failure with any version of command line git on any of the platforms I test. I regularly use non-default ssh ports in an ssh URL to a git repository and it works as expected. I've added a test for this to my private regression test suite. Can you explore further to identify what's different between your failing installation and my installation that works as expected? There is a reference to "ssh variant 'simple'" on the git mailing list . If that pull request has been merged, then it indicates you've somehow selected a variant of SSH which does not support port specification. SInce you need port specification, you'll need to reinstall or reconfigure command line git to have the complete SSH implementation, rather than the simple ssh implementation. As far as I can tell, this is not a git plugin or a git client plugin bug. It is a configuration error in command line git, or a bug in command line git.
          Hide
          mjoe Joerg Mattiello added a comment -

          see updated description with steps to reproduce

          Show
          mjoe Joerg Mattiello added a comment - see updated description with steps to reproduce
          Show
          mjoe Joerg Mattiello added a comment - https://github.com/jenkinsci/git-client-plugin/pull/297
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: mjoe
          Path:
          src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
          http://jenkins-ci.org/commit/git-client-plugin/e8e1444c7f07b52d2d9b380257b2cc81e10bb0a5
          Log:
          Setting GIT_SSH_VARIANT=ssh to environment, solves JENKINS-49111

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mjoe Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/e8e1444c7f07b52d2d9b380257b2cc81e10bb0a5 Log: Setting GIT_SSH_VARIANT=ssh to environment, solves JENKINS-49111
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Mark Waite
          Path:
          src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
          http://jenkins-ci.org/commit/git-client-plugin/21914aaf97f09abff119d3ec85838fcdc6bdb2d3
          Log:
          Merge pull request #297 from mjoe/master

          Setting GIT_SSH_VARIANT=ssh to environment, solves JENKINS-49111

          Compare: https://github.com/jenkinsci/git-client-plugin/compare/2df89c578b5c...21914aaf97f0

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/21914aaf97f09abff119d3ec85838fcdc6bdb2d3 Log: Merge pull request #297 from mjoe/master Setting GIT_SSH_VARIANT=ssh to environment, solves JENKINS-49111 Compare: https://github.com/jenkinsci/git-client-plugin/compare/2df89c578b5c...21914aaf97f0
          Hide
          markewaite Mark Waite added a comment -

          Refer to the git mailing list thread for the details which confirm that GIT_SSH_VARIANT=ssh is the correct approach.

          Thanks, Joerg Mattiello for finding the problem, and for the pull request to fix the problem!

          Show
          markewaite Mark Waite added a comment - Refer to the git mailing list thread for the details which confirm that GIT_SSH_VARIANT=ssh is the correct approach. Thanks, Joerg Mattiello for finding the problem, and for the pull request to fix the problem!
          Hide
          mjoe Joerg Mattiello added a comment -

          git-client plugin 2.7.1 released

          Show
          mjoe Joerg Mattiello added a comment - git-client plugin 2.7.1 released

            People

            • Assignee:
              Unassigned
              Reporter:
              mjoe Joerg Mattiello
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: