java.io.IOException: Unexpected reader termination

Jenkins JIRA | Brandon Jacklyn | 1 year ago
  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 | 1 year 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 | 1 year 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

    Remoting issue - Jenkins - Jenkins Wiki

    jenkins-ci.org | 3 months ago
    java.io.IOException: Unexpected termination of the channel
  6. 0

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

    serverfault.com | 5 months ago
    java.io.IOException: Unexpected termination of the channel

    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