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

Unable to use hudson-cli.jar - getting Premature EOF

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • cli
    • None
    • Platform: PC, OS: Windows XP

      I cannot get hudson-cli to work?
      I'm not running any proxys - and hudson itself works fine.
      I have downloaded hudson-cli.jar from the web page at
      http://61a213.prod.mycompany.local:8080/cli

      There is a Windows firewall running on the hudson server, and I am not allowed
      to disable it. Here's the error I get after appr. 60 seconds:

      C:\>java -jar hudson-cli.jar -s http://61a213.prod.mycompany.local:8080/ help
      Exception in thread "main" java.io.IOException: Premature EOF
      at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)
      at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)
      at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
      at java.io.FilterInputStream.read(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
      (Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
      (Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
      (Unknown Source)
      at hudson.remoting.Channel.<init>(Channel.java:310)
      at hudson.remoting.Channel.<init>(Channel.java:251)
      at hudson.remoting.Channel.<init>(Channel.java:239)
      at hudson.cli.CLI.main(CLI.java:70)

      My java version:
      c:\>Java -version
      java version "1.6.0_13"
      Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
      Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

      Hudson version: 1.303

          [JENKINS-3619] Unable to use hudson-cli.jar - getting Premature EOF

          I get the same error when on the linux box, in the wrapper log I get:
          INFO | jvm 1 | 2009/05/04 22:30:14 | May 4, 2009 10:30:14 PM hudson.remoting.Channel$ReaderThread run
          INFO | jvm 1 | 2009/05/04 22:30:14 | SEVERE: I/O error in channel HTTP full-duplex channel aac41a55-56f6-4709-9913-af6d9f5091ea
          INFO | jvm 1 | 2009/05/04 22:30:14 | java.io.StreamCorruptedException: invalid type code: 0D
          INFO | jvm 1 | 2009/05/04 22:30:14 | at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
          INFO | jvm 1 | 2009/05/04 22:30:14 | at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
          INFO | jvm 1 | 2009/05/04 22:30:14 | at hudson.remoting.Channel$ReaderThread.run(Channel.java:727)
          INFO | jvm 1 | 2009/05/04 22:30:14 | May 4, 2009 10:30:14 PM hudson.model.FullDuplexHttpChannel$1 onDead
          INFO | jvm 1 | 2009/05/04 22:30:14 | INFO: Duplex-HTTP session aac41a55-56f6-4709-9913-af6d9f5091ea is terminated

          Mirko Friedenhagen added a comment - I get the same error when on the linux box, in the wrapper log I get: INFO | jvm 1 | 2009/05/04 22:30:14 | May 4, 2009 10:30:14 PM hudson.remoting.Channel$ReaderThread run INFO | jvm 1 | 2009/05/04 22:30:14 | SEVERE: I/O error in channel HTTP full-duplex channel aac41a55-56f6-4709-9913-af6d9f5091ea INFO | jvm 1 | 2009/05/04 22:30:14 | java.io.StreamCorruptedException: invalid type code: 0D INFO | jvm 1 | 2009/05/04 22:30:14 | at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356) INFO | jvm 1 | 2009/05/04 22:30:14 | at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) INFO | jvm 1 | 2009/05/04 22:30:14 | at hudson.remoting.Channel$ReaderThread.run(Channel.java:727) INFO | jvm 1 | 2009/05/04 22:30:14 | May 4, 2009 10:30:14 PM hudson.model.FullDuplexHttpChannel$1 onDead INFO | jvm 1 | 2009/05/04 22:30:14 | INFO: Duplex-HTTP session aac41a55-56f6-4709-9913-af6d9f5091ea is terminated

          We suspect this error depends on the servlet container, so please report how you
          run the server.

          Kohsuke Kawaguchi added a comment - We suspect this error depends on the servlet container, so please report how you run the server.

          The wrapper just starts the included winstone container.

          Regards
          Mirko

          Mirko Friedenhagen added a comment - The wrapper just starts the included winstone container. Regards Mirko

          166_MMX added a comment -

          assigned the issue to the proper component

          166_MMX added a comment - assigned the issue to the proper component

          Yama Tksh added a comment -

          [for your reference] We are in similar but slightly different? trouble. @see JENKINS-7052

          Thanks, Tksh

          Yama Tksh added a comment - [for your reference] We are in similar but slightly different? trouble. @see JENKINS-7052 Thanks, Tksh

          I believe this is the same issue as JENKINS-11130. The fix for this was recently committed and should be in 1.440. If you are still willing/able then please re-test against 1.440 and report back. Otherwise I will close as this as a duplicate of 11130.

          Richard Mortimer added a comment - I believe this is the same issue as JENKINS-11130 . The fix for this was recently committed and should be in 1.440. If you are still willing/able then please re-test against 1.440 and report back. Otherwise I will close as this as a duplicate of 11130.

          Brian Davis added a comment -

          I am still receiving this error using Jenkins 1.444 and java 1.6.0_29

          Exception in thread "main" java.io.IOException: Premature EOF
          at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:538)
          at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:582)
          at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:669)
          at java.io.FilterInputStream.read(FilterInputStream.java:116)
          at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2676)
          at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2671)
          at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2660)
          at hudson.remoting.Channel.<init>(Channel.java:406)
          at hudson.remoting.Channel.<init>(Channel.java:366)
          at hudson.remoting.Channel.<init>(Channel.java:327)
          at hudson.remoting.Channel.<init>(Channel.java:323)
          at hudson.remoting.Channel.<init>(Channel.java:311)
          at hudson.cli.CLI.connectViaHttp(CLI.java:124)
          at hudson.cli.CLI.<init>(CLI.java:107)
          at hudson.cli.CLI.<init>(CLI.java:85)
          at hudson.cli.CLI._main(CLI.java:300)
          at hudson.cli.CLI.main(CLI.java:245)

          Brian Davis added a comment - I am still receiving this error using Jenkins 1.444 and java 1.6.0_29 Exception in thread "main" java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:538) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:582) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:669) at java.io.FilterInputStream.read(FilterInputStream.java:116) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2676) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2671) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2660) at hudson.remoting.Channel.<init>(Channel.java:406) at hudson.remoting.Channel.<init>(Channel.java:366) at hudson.remoting.Channel.<init>(Channel.java:327) at hudson.remoting.Channel.<init>(Channel.java:323) at hudson.remoting.Channel.<init>(Channel.java:311) at hudson.cli.CLI.connectViaHttp(CLI.java:124) at hudson.cli.CLI.<init>(CLI.java:107) at hudson.cli.CLI.<init>(CLI.java:85) at hudson.cli.CLI._main(CLI.java:300) at hudson.cli.CLI.main(CLI.java:245)

          Brian, Many thanks for taking the time to test this. Looking at your stack trace it does seem a little different to JENKINS-11130 the channel constructor is not completing so the PingThread at CLI.java:126 is not getting started.

          The Channel startup is stuck at Channel.java:406 which is where the read side code is waiting for the remoting preamble to be sent by the server.

          Are there any related error messages in the jenkins server log file. That may give clues as to what the server is seeing and why it is closing the read side connection.

          Do you have a virus scanner running on the client machine. It maybe that a virus scanner is intercepting the HTTP stream and buffering the data. This would stop the cli program receiving the output from the server and would cause a timeout as seen above. If possible it would be good to test with any virus scanners disabled.

          Richard Mortimer added a comment - Brian, Many thanks for taking the time to test this. Looking at your stack trace it does seem a little different to JENKINS-11130 the channel constructor is not completing so the PingThread at CLI.java:126 is not getting started. The Channel startup is stuck at Channel.java:406 which is where the read side code is waiting for the remoting preamble to be sent by the server. Are there any related error messages in the jenkins server log file. That may give clues as to what the server is seeing and why it is closing the read side connection. Do you have a virus scanner running on the client machine. It maybe that a virus scanner is intercepting the HTTP stream and buffering the data. This would stop the cli program receiving the output from the server and would cause a timeout as seen above. If possible it would be good to test with any virus scanners disabled.

          Oleg Nenashev added a comment -

          No response from the submitter (3-years timeout).

          Oleg Nenashev added a comment - No response from the submitter (3-years timeout).

          Daniel Beck added a comment -

          There have been fixes to this around ~1.550. Installing a new version may help.

          If something like this occurs on recent Jenkins, please file a new issue, don't just reopen this one.
          https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue

          Daniel Beck added a comment - There have been fixes to this around ~1.550. Installing a new version may help. If something like this occurs on recent Jenkins, please file a new issue, don't just reopen this one. https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue

            Unassigned Unassigned
            nielsull nielsull
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: