java.io.IOException: Unexpected reader termination

Jenkins JIRA | Brandon Jacklyn | 2 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    In our environment, during git polling (Git Polling Log) the following command causes an OutOfMemoryException attempting to read a 2GB+? String from a ByteArrayOutputStream (~1GB when I copied it from the heap dump to a .txt file). This is the offending command: {code}/usr/bin/git log --full-history --no-abbrev --format=raw -M -m --raw <previous_build_sha1>..<polling_sha1> # timeout=10 {code} The actual error in the build log is: {code}ERROR: Connection was broken: java.io.IOException: Unexpected reader termination at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:76) Caused by: java.lang.OutOfMemoryError: Requested array size exceeds VM limit{code} This is due to the two commits being 1000's of commits/1000's of files different. When this error occurs the JVM ends up in such a bad state that the ssh-slaves-plugin is unable to relaunch the slaves, and all our machines go offline when this happens on a machine. Details: GitSCM.isRevExcluded() calls CliGitAPIImpl.showRevision() which calls the "git log \-full-history .." command. Only 3 extensions implement isRevExcluded(): PathRestriction.class, MessageExclusion.class, and UserExclusion.class. These extensions require commit files, commit message, and commit author respectively. Since the vast majority of the size of the ByteArray is from the commit file info, my proposal is to remove the "--raw" if the PathRestriction extension is not being used by the job: {code}/usr/bin/git log --full-history --no-abbrev --format=raw -M -m <previous_build_sha1>..<polling_sha1> # timeout=10{code}

    Jenkins JIRA | 2 years ago | Brandon Jacklyn
    java.io.IOException: Unexpected reader termination
  2. 0

    In our environment, during git polling (Git Polling Log) the following command causes an OutOfMemoryException attempting to read a 2GB+? String from a ByteArrayOutputStream (~1GB when I copied it from the heap dump to a .txt file). This is the offending command: {code}/usr/bin/git log --full-history --no-abbrev --format=raw -M -m --raw <previous_build_sha1>..<polling_sha1> # timeout=10 {code} The actual error in the build log is: {code}ERROR: Connection was broken: java.io.IOException: Unexpected reader termination at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:76) Caused by: java.lang.OutOfMemoryError: Requested array size exceeds VM limit{code} This is due to the two commits being 1000's of commits/1000's of files different. When this error occurs the JVM ends up in such a bad state that the ssh-slaves-plugin is unable to relaunch the slaves, and all our machines go offline when this happens on a machine. Details: GitSCM.isRevExcluded() calls CliGitAPIImpl.showRevision() which calls the "git log \-full-history .." command. Only 3 extensions implement isRevExcluded(): PathRestriction.class, MessageExclusion.class, and UserExclusion.class. These extensions require commit files, commit message, and commit author respectively. Since the vast majority of the size of the ByteArray is from the commit file info, my proposal is to remove the "--raw" if the PathRestriction extension is not being used by the job: {code}/usr/bin/git log --full-history --no-abbrev --format=raw -M -m <previous_build_sha1>..<polling_sha1> # timeout=10{code}

    Jenkins JIRA | 2 years ago | Brandon Jacklyn
    java.io.IOException: Unexpected reader termination
  3. 0

    Openshift Jenkins build fails to remove temp shell script on builder

    Stack Overflow | 3 years ago | Juho Rutila
    java.io.IOException: Unexpected termination of the channel
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins Linux Slave error: SEVERE: I/O error in channel channel - Server Fault

    serverfault.com | 10 months ago
    java.io.IOException: Unexpected termination of the channel
  6. 0

    Doing something else before invoking slave.jar in slave launch script

    Google Groups | 5 years ago | Romu
    hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel at hudson.remoting.Request.call(Request.java:174) <http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.Request.call&entity=method> at hudson.remoting.Channel.call(Channel.java:663) <http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.Channel.call&entity=method> at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:349) <http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer.setChannel&entity=method> at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:317) <http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer.setChannel&entity=method> at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200) <http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer$1.call&entity=method>

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      Unexpected reader termination

      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run()
    2. Hudson :: Remoting Layer
      SynchronousCommandTransport$ReaderThread.run
      1. hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:76)
      1 frame