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

Jenkins CLI: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A

      We use the jenkins-cli.jar to attach new slaves and this has been working successfully in v1.534, however when upgrading to v1.554.1, we are unable to do so and a "SEVERE: I/O error in channel Chunked connection" error occurs.

      Tested on linux slaves using java version "1.6.0_35" and "1.7.0_45" and the same error occurs.

      Attached console output to error.log

      Workaround: -Dhudson.diyChunking=false on both slave/agent and master sides

          [JENKINS-23232] Jenkins CLI: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A

          Pere Orga added a comment -

          I got rid of this by enabling the TCP port for JNLP slave agents

          Thank you.

          Pere Orga added a comment - I got rid of this by enabling the TCP port for JNLP slave agents Thank you.

          Still happens randomly with 1.625.1 LTS when using jenkins-cli.jar to upload job config.xml file. Sometimes it fails after couple of requests sometimes after 20+.
          Server and client are running on CentOS 7.1
          I have -Dhudson.diyChunking=false in /etc/sysconfig/jenkins
          Enabling TCP port for JNLP slave agents seems to fix this or at least reduce the frequency.

          Slawomir Czarko added a comment - Still happens randomly with 1.625.1 LTS when using jenkins-cli.jar to upload job config.xml file. Sometimes it fails after couple of requests sometimes after 20+. Server and client are running on CentOS 7.1 I have -Dhudson.diyChunking=false in /etc/sysconfig/jenkins Enabling TCP port for JNLP slave agents seems to fix this or at least reduce the frequency.

          Jeff Feldstein added a comment - - edited

          I've been working with this all day today in both 1.6.25.2 and 1.638
          Centos 6.5
          jenkins-build-monitor plugin is installed
          If the default view is "All" in config.xml, jenkins-cli works.
          If the default view is changed to a view defined by jenkins-build-monitor, the following stack trace occurs:

          oot@zmon10 jenkins]# java -jar /usr/local/bin/jenkins-cli.jar -s http://localhost:8080 version
          Nov 13, 2015 1:50:10 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
          SEVERE: I/O error in channel Chunked connection to http://localhost:8080/cli
          java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A
          	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806)
          	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
          	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
          	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
          	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
          
          hudson.remoting.RequestAbortedException: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A
          	at hudson.remoting.Request.abort(Request.java:297)
          	at hudson.remoting.Channel.terminate(Channel.java:847)
          	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69)
          	at ......remote call to Chunked connection to http://localhost:8080/cli(Native Method)
          	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
          	at hudson.remoting.Request.call(Request.java:172)
          	at hudson.remoting.Channel.call(Channel.java:780)
          	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:250)
          	at hudson.remoting.$Proxy1.waitForProperty(Unknown Source)
          	at hudson.remoting.Channel.waitForRemoteProperty(Channel.java:1258)
          	at hudson.cli.CLI.<init>(CLI.java:147)
          	at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
          	at hudson.cli.CLI._main(CLI.java:479)
          	at hudson.cli.CLI.main(CLI.java:390)
          Caused by: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A
          	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806)
          	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
          	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
          	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
          	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
          

          This line in config.xml works:

           <primaryView>All</primaryView>
          

          This line in config.xml causes the stack trace above:

           <primaryView>SYNCl</primaryView>
          

          Jeff Feldstein added a comment - - edited I've been working with this all day today in both 1.6.25.2 and 1.638 Centos 6.5 jenkins-build-monitor plugin is installed If the default view is "All" in config.xml, jenkins-cli works. If the default view is changed to a view defined by jenkins-build-monitor, the following stack trace occurs: oot@zmon10 jenkins]# java -jar /usr/local/bin/jenkins-cli.jar -s http: //localhost:8080 version Nov 13, 2015 1:50:10 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run SEVERE: I/O error in channel Chunked connection to http: //localhost:8080/cli java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299) at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48) at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) hudson.remoting.RequestAbortedException: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at hudson.remoting.Request.abort(Request.java:297) at hudson.remoting.Channel.terminate(Channel.java:847) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69) at ......remote call to Chunked connection to http: //localhost:8080/cli(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) at hudson.remoting.Request.call(Request.java:172) at hudson.remoting.Channel.call(Channel.java:780) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:250) at hudson.remoting.$Proxy1.waitForProperty(Unknown Source) at hudson.remoting.Channel.waitForRemoteProperty(Channel.java:1258) at hudson.cli.CLI.<init>(CLI.java:147) at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72) at hudson.cli.CLI._main(CLI.java:479) at hudson.cli.CLI.main(CLI.java:390) Caused by: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299) at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48) at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) This line in config.xml works: <primaryView>All</primaryView> This line in config.xml causes the stack trace above: <primaryView>SYNCl</primaryView>

          Daniel Beck added a comment -

          Needs a release of executable-war with https://github.com/jenkinsci/extras-executable-war/commit/5a5f01362e7649da3b39a3a45940ba3ce1ab65e8

          oleg_nenashev Any idea whether you can release this?

          Daniel Beck added a comment - Needs a release of executable-war with https://github.com/jenkinsci/extras-executable-war/commit/5a5f01362e7649da3b39a3a45940ba3ce1ab65e8 oleg_nenashev Any idea whether you can release this?

          Oleg Nenashev added a comment -

          danielbeck Not sure, but I'll give a try. FTR JENKINS-34287

          Oleg Nenashev added a comment - danielbeck Not sure, but I'll give a try. FTR JENKINS-34287

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - PR is ready for review: https://github.com/jenkinsci/extras-executable-war/pull/7

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          pom.xml
          src/main/java/Main.java
          http://jenkins-ci.org/commit/extras-executable-war/b12662aed40ee06a75c03a51a6fc87a75c642179
          Log:
          [JENKINS-34287,JENKINS-23232] Update the component towards 1.34 (#7)

          • Update to the latest Parent POM and Java 7
          • FindBugs: Propagate issues with file deletion
          • Pick parent POM 1.37 with Java 7 support
          • FindBugs: Fix resource leak when exception happens during the dependency list read
          • Downgrade the code to Java 6
          • Downgrade back to Java 1.3
          • Address comment from @rsandell. Just in case

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/Main.java http://jenkins-ci.org/commit/extras-executable-war/b12662aed40ee06a75c03a51a6fc87a75c642179 Log: [JENKINS-34287,JENKINS-23232] Update the component towards 1.34 (#7) Update to the latest Parent POM and Java 7 FindBugs: Propagate issues with file deletion Pick parent POM 1.37 with Java 7 support FindBugs: Fix resource leak when exception happens during the dependency list read Downgrade the code to Java 6 Downgrade back to Java 1.3 Address comment from @rsandell. Just in case

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/24443acb3c92612dc623849c9458000c98a0a265 Log: [JENKINS-34287,JENKINS-23232] Update executable-war to 1.34 Diff: https://github.com/jenkinsci/extras-executable-war/compare/executable-war-1.33...executable-war-1.34 https://issues.jenkins-ci.org/browse/JENKINS-23232 https://issues.jenkins-ci.org/browse/JENKINS-34287

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/d7598f118fd6d9989164cd2ff7126001a6ee2ff2 Log: [JENKINS-34287,JENKINS-23232] Update executable-war to 1.34 (#2565) Diff: https://github.com/jenkinsci/extras-executable-war/compare/executable-war-1.33...executable-war-1.34 https://issues.jenkins-ci.org/browse/JENKINS-23232 https://issues.jenkins-ci.org/browse/JENKINS-34287

          Oleg Nenashev added a comment -

          The fix is integrated towards 2.24

          Oleg Nenashev added a comment - The fix is integrated towards 2.24

            oleg_nenashev Oleg Nenashev
            ashokm Ashok Manji
            Votes:
            6 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: