Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 following error

Aug 05, 2015 6:01:02 AM hudson.remoting.SynchronousCommandTransport$ReaderThread run SEVERE: I/O error in channel Chunked connection to http://jenkins.server.com/cli java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804) at java.io.ObjectInputStream.(ObjectInputStream.java:299) at hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:40) 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:296) at hudson.remoting.Channel.terminate(Channel.java:815) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69) at ......remote call to Chunked connection to http://jenkins.server.com/cli(Native Method) at 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) at hudson.remoting.Channel.waitForRemoteProperty(Channel.java:1205) at 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) at java.io.ObjectInputStream.(ObjectInputStream.java:299) at hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:40) at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

like image 973
sandy_ws Avatar asked Aug 05 '15 06:08

sandy_ws


2 Answers

Go to Configure Global Security > TCP port for JNLP agents and chose Random save and run your command again

like image 76
Fadel Avatar answered Oct 25 '22 02:10

Fadel


It seems this is a similar problem as: https://issues.jenkins-ci.org/browse/JENKINS-23232

It suggests that you can add in your Jenkins system config:

JAVA_ARGS="-Dhudson.diyChunking=false"

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

You will need to do a restart of the Jenkins server

like image 26
Cheuk Leung Avatar answered Oct 25 '22 00:10

Cheuk Leung