Jenkins cli command gives error java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A

I am trying to execute jenkins cli command

java -jar /home/jenkins/jenkins-cli.jar -s http://jenkins.server.com/ version --username jenkins --password jenkins 

Getting the following error

August 5, 2015 6:01:02 hudson.remoting.SynchronousCommandTransport $ ReaderThread run SEVERE: Channel I / O error Channel connection with http://jenkins.server.com/cli java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at java.io.ObjectInputStream.readStreamHeader (ObjectInputStream.java:804) in java.io.ObjectInputStream. (ObjectInputStream.java:299) in hudson.remoting.ObjectInputStreamEx. (ObjectInputStreamEx.java:40) in hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read (AbstractSynchronousByteArrayCommandTransport.java:34) in hudson.remoting.SynchronousCommandTransport $ ReaderThread.run (SynchronousComavaTuma

hudson.remoting.RequestAbortedException: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at hudson.remoting.Request.abort (Request.java:296) at hudson.remoting.Channel.terminate (Channel.java:815) at remoting.SynchronousCommandTransport $ ReaderThread.run (SynchronousCommandTransport.java:69) at ...... remote call of the Chunked connection from the http://jenkins.server.com/cli(Native Method) with hudson.remoting.Channel.attachCallSiteStackTrace (Channel.java:1361) at hudson.remoting.Request.call (Request.java:171) at hudson.remoting.Channel.call (Channel.java:752) at hudson.remoting.RemoteInvocationHandler.invoke (RemoteInvocationHandler.java: 179) at hudson.remoting. $ Proxy1.waitForProperty (Unknown source) in hudson.remoting.Channel.waitForRemoteProperty (Channel.java:1205) in hudson.cli.CLI. (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:804) in java.io.ObjectInputStream. (ObjectInputStream.java:299) in hudson.remoting.ObjectInputStreamEx. (ObjectInputStreamEx.java:40) in hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read (AbstractSynchronousByteArrayCommandTransport.java:34) in hudson.remoting.SynchronousCommandTransport $ ReaderThread.run (SynchronousComavaTuma

+5
source share
3 answers

Go to Global Security Configuration> TCP Port for JNLP Agents and select Random, save and run your command again

+6
source

This seems to be a similar problem: https://issues.jenkins-ci.org/browse/JENKINS-23232

This suggests that you can add to the Jenkins system configuration:

JAVA_ARGS = "- Dhudson.diyChunking = false"

(in / etc / sysconfig / jenkins for RHEL ; / etc / default / jenkins for Ubuntu / Debian )

You will need to restart the Jenkins server

+4
source

The only thing that worked for me was:

 sudo apt-get install openjdk-7-jre 
0
source

All Articles