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

java.io.IOException: Premature EOF when shutdown CLI command is used

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • cli, core
    • Tested on Jenkins 2.103, and Jenkins 2.73.3
    • (towards) 2.151

    Description

      Premature EOF is launched when shutdown is requested from CLI but Jenkins instance is properly stoped.

      [jenkins@host]~ $ java -jar enkins-cli.jar -s http://127.0.0.1:8080 -auth jenkins:c0044e5a6e3addsaa39401ca7d688d0c7e shutdown 
      Jan 22, 2018 3:38:35 PM hudson.cli.PlainCLIProtocol$EitherSide$Reader run 
      WARNING: null 
      hudson.cli.DiagnosedStreamCorruptionException 
      Read back: 
      Read ahead: 
      Diagnosis problem: 
      java.io.IOException: Premature EOF 
      at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) 
      at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) 
      at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) 
      at java.io.FilterInputStream.read(FilterInputStream.java:133) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3393) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3386) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3374) 
      at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:58) 
      at hudson.cli.FlightRecorderInputStream$1.run(FlightRecorderInputStream.java:59) 
      at hudson.cli.FlightRecorderInputStream.analyzeCrash(FlightRecorderInputStream.java:82) 
      at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:145) 
      Caused by: java.io.IOException: Premature EOF 
      at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) 
      at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) 
      at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) 
      at java.io.FilterInputStream.read(FilterInputStream.java:133) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3393) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3386) 
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3374) 
      at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:58)
      

      https://github.com/jenkinsci/jenkins/blob/0d1f80ba9f58d879cf562941b2d7ca2d6bb970f6/core/src/main/java/jenkins/model/Jenkins.java#L4219

      Attachments

        Issue Links

          Activity

            Hi escoem,

            I am not sure if you have provided the right jenkins name here(127.0.0.1), but I assume the reason for the error seems to be the client connection timeout set on the system(or a proxy, if there is one). At least this was true in my case. The proxy had a client timeout set to 1m.  You can check that and reconfirm if this error is really not because of timeout.

             

            Best Regards, Madhav

            madhavkulkarni1986 Madhava Kulkarni added a comment - Hi escoem , I am not sure if you have provided the right jenkins name here(127.0.0.1), but I assume the reason for the error seems to be the client connection timeout set on the system(or a proxy, if there is one). At least this was true in my case. The proxy had a client timeout set to 1m.  You can check that and reconfirm if this error is really not because of timeout.   Best Regards, Madhav

            Thanks madhavkulkarni1986 but is a direct connection, not related to a proxy at all. Jenkins is running on 127.0.0.1:8080

            escoem Emilio Escobar added a comment - Thanks madhavkulkarni1986 but is a direct connection, not related to a proxy at all. Jenkins is running on 127.0.0.1:8080
            mramonleon Ramon Leon added a comment - PR:  https://github.com/jenkinsci/jenkins/pull/3695

            Merged towards 2.151

            batmat Baptiste Mathus added a comment - Merged towards 2.151

            People

              mramonleon Ramon Leon
              escoem Emilio Escobar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: