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

CLI over SSH hangs or show warning when a command closes the stdout/stderr

    • sshd-plugin:3.237.v883d165a_c1d3

      CLI Commands that close the stdout (OutputStream) hang forever or sometimes show the following warning when using SSH:

      org.apache.sshd.common.SshException: flush(ChannelOutputStream[ChannelSession[id=0, recipient=0]-ServerSessionImpl[admin@/127.0.0.1:61179]] SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
      	at org.apache.sshd.common.channel.ChannelOutputStream.flush(ChannelOutputStream.java:169)
      	at org.jenkinsci.main.modules.sshd.AsynchronousCommand$1.run(AsynchronousCommand.java:114)
      	at java.lang.Thread.run(Thread.java:748)
      

      For example the export-configuration command of the Configuration as Code plugin.

      java -jar jenkins-cli.jar -s http://allan.cje.com:8081/ -user admin -ssh export-configuration
      

      Or

      ssh -l admin -p 2222 allan.cje.com export-configuration
      

      Most likely caused by a bug in SSHD Core and upstream with https://issues.apache.org/jira/browse/SSHD-1257. That will be fixed in SSHD Core 2.9.0, currently unreleased.

      Though maybe a wrapper in CLICommand could prevent closure of the stdout.

          [JENKINS-68541] CLI over SSH hangs or show warning when a command closes the stdout/stderr

          Allan BURDAJEWICZ created issue -
          Allan BURDAJEWICZ made changes -
          Summary Original: CLI over SSH hangs with some command that close the OutputStream New: CLI over SSH hangs when a command closes the stdout/stderr
          Allan BURDAJEWICZ made changes -
          Summary Original: CLI over SSH hangs when a command closes the stdout/stderr New: CLI over SSH hangs or show warning when a command closes the stdout/stderr
          Allan BURDAJEWICZ made changes -
          Description Original: CLI Commands that close the stdout (OutputStream) hang forever when using SSH.

          For example the {{export-configuration}} command of the Configuration as Code plugin.

          {code}
          java -jar jenkins-cli.jar -s http://allan.cje.com:8081/ -user admin -ssh export-configuration
          {code}

          Most likely caused by a bug in SSHD Core and upstream with https://issues.apache.org/jira/browse/SSHD-1257. That will be fixed in SSHD Core 2.9.0, currently unreleased.

          Though maybe a wrapper in {{CLICommand}} could prevent closure of the {{stdout}}.
          New: CLI Commands that close the stdout (OutputStream) hang forever or sometimes show the following warning when using SSH:

          {code}
          org.apache.sshd.common.SshException: flush(ChannelOutputStream[ChannelSession[id=0, recipient=0]-ServerSessionImpl[admin@/127.0.0.1:61179]] SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
          at org.apache.sshd.common.channel.ChannelOutputStream.flush(ChannelOutputStream.java:169)
          at org.jenkinsci.main.modules.sshd.AsynchronousCommand$1.run(AsynchronousCommand.java:114)
          at java.lang.Thread.run(Thread.java:748)
          {code}

          For example the {{export-configuration}} command of the Configuration as Code plugin.

          {code}
          java -jar jenkins-cli.jar -s http://allan.cje.com:8081/ -user admin -ssh export-configuration
          {code}

          Or

          {code}
          ssh -l admin -p 2222 export-configuration
          {code}

          Most likely caused by a bug in SSHD Core and upstream with https://issues.apache.org/jira/browse/SSHD-1257. That will be fixed in SSHD Core 2.9.0, currently unreleased.

          Though maybe a wrapper in {{CLICommand}} could prevent closure of the {{stdout}}.
          Vincent Latombe made changes -
          Remote Link New: This issue links to "SSHD-1257 (Web Link)" [ 27772 ]
          Allan BURDAJEWICZ made changes -
          Assignee New: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "sshd-plugin #74 (Web Link)" [ 27773 ]
          Allan BURDAJEWICZ made changes -
          Released As New: sshd-plugin:3.237.v883d165a_c1d3
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            allan_burdajewicz Allan BURDAJEWICZ
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: