java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Host system {noformat} $ lsb_release -idrc Distributor ID: Debian Description: Debian GNU/Linux 5.0.8 (lenny) Release: 5.0.8 Codename: lenny {noformat} Java version {noformat} $ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing) {noformat} Installed software with versions {noformat} $ apt-show-versions -r -p 'jenkins.*|apache2.*|libapache2-.*' | column -t apache2/lenny uptodate 2.2.9-10+lenny9 apache2-doc/lenny uptodate 2.2.9-10+lenny9 apache2-mpm-prefork/lenny uptodate 2.2.9-10+lenny9 apache2-utils/lenny uptodate 2.2.9-10+lenny9 apache2.2-common/lenny uptodate 2.2.9-10+lenny9 jenkins/binary uptodate 1.408 libapache2-mod-auth-mysql/lenny uptodate 4.3.9-11 libapache2-mod-auth-openid/lenny uptodate 0.3-2 libapache2-mod-encoding/lenny uptodate 20040616-5 libapache2-mod-fcgid/lenny uptodate 1:2.2-1+lenny1 libapache2-mod-geoip/lenny uptodate 1.1.8-2 libapache2-mod-php5/lenny uptodate 5.2.6.dfsg.1-1+lenny10 libapache2-mod-python/lenny uptodate 3.3.1-7 libapache2-mod-wsgi/lenny uptodate 2.5-1~lenny1 {noformat} Loaded Apache2 modules (maybe this could be relevant, i don't know) {noformat} $ find /etc/apache2/mods-enabled/ -name '*.load' | sed 's|.*/||' | sort | column alias.load authz_user.load geoip.load rewrite.load auth_basic.load autoindex.load mime.load setenvif.load auth_mysql.load cgi.load negotiation.load status.load authn_file.load deflate.load php5.load wsgi.load authz_default.load dir.load proxy_http.load authz_groupfile.load env.load proxy.load authz_host.load fcgid.load python.load {noformat} The reverse proxy setup {noformat} $ cat /etc/apache2/conf.d/jenkins.conf ProxyPass /jenkins http://localhost:8080/jenkins ProxyPassReverse /jenkins http://localhost:8080/jenkins # Local reverse proxy authorization override # Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu) <Proxy http://localhost:8080/jenkins*> Order deny,allow Allow from all </Proxy> {noformat} After invoking the command it takes a long time until the CLI dose throw the error. I suppose it's just the long time out {noformat} $ java -jar jenkins-cli.jar -s http://localhost/jenkins/ version 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:2512) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2507) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2496) at hudson.remoting.Channel.<init>(Channel.java:386) at hudson.remoting.Channel.<init>(Channel.java:348) at hudson.remoting.Channel.<init>(Channel.java:309) at hudson.remoting.Channel.<init>(Channel.java:305) at hudson.remoting.Channel.<init>(Channel.java:293) at hudson.cli.CLI.<init>(CLI.java:92) at hudson.cli.CLI.<init>(CLI.java:63) at hudson.cli.CLI.main(CLI.java:182) {noformat} The Jenkins server log dose contain such an entry for each failed connection attempt {noformat} $ cat /var/log/jenkins/jenkins.log Apr 23, 2011 8:50:30 AM hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel HTTP full-duplex channel 5a8a8941-e820-4b03-a52e-5f45c4112afc java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.net.SocketInputStream.read(SocketInputStream.java:182) at winstone.WinstoneInputStream.read(WinstoneInputStream.java:49) at hudson.util.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:223) at hudson.util.ChunkedInputStream.nextChunk(ChunkedInputStream.java:197) at hudson.util.ChunkedInputStream.read(ChunkedInputStream.java:120) at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hudson.remoting.Channel$ReaderThread.run(Channel.java:992) {noformat} Interestingly the connection dose work fine when I connect directly to it {noformat} $ java -jar jenkins-cli.jar -s http://localhost:8080/jenkins/ version 1.408 {noformat}
    via by 166_MMX,
  • Have jenkins setup on http port 8080 or AJP port 8009. Put a reverse proxy in front of it (in this case apache) Disable JNLP port. Download and run the client tools: java -jar jenkins-cli.jar -s http://192.168.122.3/ help This will hang for some time and error out: Exception in thread "main" java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:556) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2582) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2577) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2566) 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:122) at hudson.cli.CLI.<init>(CLI.java:105) at hudson.cli.CLI.<init>(CLI.java:83) at hudson.cli.CLI._main(CLI.java:267) at hudson.cli.CLI.main(CLI.java:216) I've attached a sample debug from jenkins in not working mode. If I switch to using HAProxy, it succeeds but takes about 20 seconds to do so. Using the CLI to contact the port directly takes less than a second. Something here is causing non jnlp cli connections to fail.
    via by Mike McGrath,
  • Host system {noformat} $ lsb_release -idrc Distributor ID: Debian Description: Debian GNU/Linux 5.0.8 (lenny) Release: 5.0.8 Codename: lenny {noformat} Java version {noformat} $ java -version java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing) {noformat} Installed software with versions {noformat} $ apt-show-versions -r -p 'jenkins.*|apache2.*|libapache2-.*' | column -t apache2/lenny uptodate 2.2.9-10+lenny9 apache2-doc/lenny uptodate 2.2.9-10+lenny9 apache2-mpm-prefork/lenny uptodate 2.2.9-10+lenny9 apache2-utils/lenny uptodate 2.2.9-10+lenny9 apache2.2-common/lenny uptodate 2.2.9-10+lenny9 jenkins/binary uptodate 1.408 libapache2-mod-auth-mysql/lenny uptodate 4.3.9-11 libapache2-mod-auth-openid/lenny uptodate 0.3-2 libapache2-mod-encoding/lenny uptodate 20040616-5 libapache2-mod-fcgid/lenny uptodate 1:2.2-1+lenny1 libapache2-mod-geoip/lenny uptodate 1.1.8-2 libapache2-mod-php5/lenny uptodate 5.2.6.dfsg.1-1+lenny10 libapache2-mod-python/lenny uptodate 3.3.1-7 libapache2-mod-wsgi/lenny uptodate 2.5-1~lenny1 {noformat} Loaded Apache2 modules (maybe this could be relevant, i don't know) {noformat} $ find /etc/apache2/mods-enabled/ -name '*.load' | sed 's|.*/||' | sort | column alias.load authz_user.load geoip.load rewrite.load auth_basic.load autoindex.load mime.load setenvif.load auth_mysql.load cgi.load negotiation.load status.load authn_file.load deflate.load php5.load wsgi.load authz_default.load dir.load proxy_http.load authz_groupfile.load env.load proxy.load authz_host.load fcgid.load python.load {noformat} The reverse proxy setup {noformat} $ cat /etc/apache2/conf.d/jenkins.conf ProxyPass /jenkins http://localhost:8080/jenkins ProxyPassReverse /jenkins http://localhost:8080/jenkins # Local reverse proxy authorization override # Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu) <Proxy http://localhost:8080/jenkins*> Order deny,allow Allow from all </Proxy> {noformat} After invoking the command it takes a long time until the CLI dose throw the error. I suppose it's just the long time out {noformat} $ java -jar jenkins-cli.jar -s http://localhost/jenkins/ version 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:2512) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2507) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2496) at hudson.remoting.Channel.<init>(Channel.java:386) at hudson.remoting.Channel.<init>(Channel.java:348) at hudson.remoting.Channel.<init>(Channel.java:309) at hudson.remoting.Channel.<init>(Channel.java:305) at hudson.remoting.Channel.<init>(Channel.java:293) at hudson.cli.CLI.<init>(CLI.java:92) at hudson.cli.CLI.<init>(CLI.java:63) at hudson.cli.CLI.main(CLI.java:182) {noformat} The Jenkins server log dose contain such an entry for each failed connection attempt {noformat} $ cat /var/log/jenkins/jenkins.log Apr 23, 2011 8:50:30 AM hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel HTTP full-duplex channel 5a8a8941-e820-4b03-a52e-5f45c4112afc java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.net.SocketInputStream.read(SocketInputStream.java:182) at winstone.WinstoneInputStream.read(WinstoneInputStream.java:49) at hudson.util.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:223) at hudson.util.ChunkedInputStream.nextChunk(ChunkedInputStream.java:197) at hudson.util.ChunkedInputStream.read(ChunkedInputStream.java:120) at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hudson.remoting.Channel$ReaderThread.run(Channel.java:992) {noformat} Interestingly the connection dose work fine when I connect directly to it {noformat} $ java -jar jenkins-cli.jar -s http://localhost:8080/jenkins/ version 1.408 {noformat}
    via by 166_MMX,
  • Have jenkins setup on http port 8080 or AJP port 8009. Put a reverse proxy in front of it (in this case apache) Disable JNLP port. Download and run the client tools: java -jar jenkins-cli.jar -s http://192.168.122.3/ help This will hang for some time and error out: Exception in thread "main" java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:556) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2582) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2577) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2566) 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:122) at hudson.cli.CLI.<init>(CLI.java:105) at hudson.cli.CLI.<init>(CLI.java:83) at hudson.cli.CLI._main(CLI.java:267) at hudson.cli.CLI.main(CLI.java:216) I've attached a sample debug from jenkins in not working mode. If I switch to using HAProxy, it succeeds but takes about 20 seconds to do so. Using the CLI to contact the port directly takes less than a second. Something here is causing non jnlp cli connections to fail.
    via by Mike McGrath,
    • 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)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    2 more bugmates