• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ssh-plugin
    • None
    • Jenkins 2.32.3
      SSH plugin 2.4
      Ubuntu 16.04.2 LTS
      OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016

      Execute script on remote host using SSH build step failes with Connection timed out error if there is an ProxyCommand confiugred (e.g.: for jumphost)

      Stack trace

      [SSH] Exception:java.net.ConnectException: Connection timed out (Connection timed out)
      com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out (Connection timed out)
      	at com.jcraft.jsch.Util.createSocket(Util.java:341)
      	at com.jcraft.jsch.Session.connect(Session.java:182)
      	at com.jcraft.jsch.Session.connect(Session.java:150)
      	at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141)
      	at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151)
      	at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:60)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.Build$BuildExecution.build(Build.java:205)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1728)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
      	at java.net.PlainSocketImpl.socketConnect(Native Method)
      	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      	at java.net.Socket.connect(Socket.java:589)
      	at java.net.Socket.connect(Socket.java:538)
      	at java.net.Socket.<init>(Socket.java:434)
      	at java.net.Socket.<init>(Socket.java:211)
      	at com.jcraft.jsch.Util.createSocket(Util.java:335)
      	... 14 more
      Build step 'Execute shell script on remote host using ssh' marked build as failure

       

      SSH Configuration

      /etc/ssh/ssh_config
      Host dev*
          ProxyCommand ssh -W %h:%p jenkins@jumphost -p 22
          CheckHostIP no
          Compression yes
          Protocol 2
      

       

       

          [JENKINS-43209] SSH connection with ProxyCommand times out

          Peter Pribula added a comment -

          These 2 issues seem to have the same source: the lack of support of ProxyCommand configuration on the SSH task.

          Peter Pribula added a comment - These 2 issues seem to have the same source: the lack of support of  ProxyCommand  configuration on the SSH task.

          Peter Pribula added a comment -

          The same issue is also occurs when:

          • Executing the job on a slave (jumphost in this case, no ProxyCommand in this case)
          • Job is configured by SSH Agent plugin to copy the SSH keys
          • Using the same Execute script on remote host using SSH

          Peter Pribula added a comment - The same issue is also occurs when: Executing the job on a slave (jumphost in this case, no ProxyCommand in this case) Job is configured by SSH Agent plugin to copy the SSH keys Using the same Execute script on remote host using SSH

          zaenk Yes, i have the same issue on Slave as connecting to internal network, but fortunately i can temporarily pick an alternative to Publish Over SSH until it's going to be fixed.

          github.com/caryyu added a comment - zaenk Yes, i have the same issue on Slave as connecting to internal network, but fortunately i can temporarily pick an alternative to Publish Over SSH until it's going to be fixed.

            Unassigned Unassigned
            zaenk Peter Pribula
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: