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

email notification corrupted due to build failure "FATAL: java.io.IOException: Unexpected termination of the channel"

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • None
    • email-ext plugin version- 2.40.5
      token macro- 1.10

      [what]
      email notification reached to recipient but wrong content in subject and body due to environment variables(like $JOB_NAME, $BUILD_NUMBER) used in subject or in body but not expanded to actual value.
      this issue when build failed due to below thrown Jenkins master-slave connection :

      stacktrace below:
      FATAL: java.io.IOException: Unexpected termination of the channel
      hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel
      at hudson.remoting.Request.abort(Request.java:295)
      at hudson.remoting.Channel.terminate(Channel.java:814)
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69)
      at ......remote call to jptolx22585(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
      at hudson.remoting.Request.call(Request.java:171)
      at hudson.remoting.Channel.call(Channel.java:751)
      at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:173)
      at com.sun.proxy.$Proxy50.join(Unknown Source)
      at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:979)
      at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
      at hudson.model.Run.execute(Run.java:1745)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Caused by: java.io.IOException: Unexpected termination of the channel
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
      Caused by: java.io.EOFException
      at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2325)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2794)
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
      at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
      at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:40)
      at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

          [JENKINS-31177] email notification corrupted due to build failure "FATAL: java.io.IOException: Unexpected termination of the channel"

          Alex Earl added a comment -

          Looks like a remoting issue, not an issue with email-ext.

          Alex Earl added a comment - Looks like a remoting issue, not an issue with email-ext.

          hiteswar kumar added a comment - - edited

          Hi Alex ,
          U r right , build failed due to slave connection issue .
          But my question on email-ext is that -
          This Build failure trigger email to correct recipient but environment variable used in subject and body not expanded to actual value. Either email-ext should not send email if remote connection impacted email-ext OR should Send mail with correct Value of environment var . What do you think ?

          hiteswar kumar added a comment - - edited Hi Alex , U r right , build failed due to slave connection issue . But my question on email-ext is that - This Build failure trigger email to correct recipient but environment variable used in subject and body not expanded to actual value. Either email-ext should not send email if remote connection impacted email-ext OR should Send mail with correct Value of environment var . What do you think ?

          Alex Earl added a comment -

          The values are actually replaced by either token macro or core functions. Email-ext doesn't directly replace the values.

          Alex Earl added a comment - The values are actually replaced by either token macro or core functions. Email-ext doesn't directly replace the values.

          Alex Earl added a comment -

          Environment variables would be from the slave, if the slave is not available then email-ext can't get the values. Also, email-ext has no way of knowing that the slave is not reachable.

          Alex Earl added a comment - Environment variables would be from the slave, if the slave is not available then email-ext can't get the values. Also, email-ext has no way of knowing that the slave is not reachable.

          so what could be suggested from plugin(email-ext) point of view when slave not reachable during email notification.
          1. let email-ext should send corrupted info to recipient.
          or
          2. email-ext should send actual build failure related information like:

          • it should check slave connection and able to collect environment variable , if not able to get env value and slave access then insert a line in email-body as default- "could not access environment variable due to slave connection. please fix the slave connection and retry build to get correct email notification"
            or
            3. any other way , email-ext should send correct info to recipient.

          hiteswar kumar added a comment - so what could be suggested from plugin(email-ext) point of view when slave not reachable during email notification. 1. let email-ext should send corrupted info to recipient. or 2. email-ext should send actual build failure related information like: it should check slave connection and able to collect environment variable , if not able to get env value and slave access then insert a line in email-body as default- "could not access environment variable due to slave connection. please fix the slave connection and retry build to get correct email notification" or 3. any other way , email-ext should send correct info to recipient.

          Alex Earl added a comment -

          Email-ext will not check the status of slaves. The current method of not replacing the variables will remain.

          Alex Earl added a comment - Email-ext will not check the status of slaves. The current method of not replacing the variables will remain.

            slide_o_mix Alex Earl
            hiteswar_kumar hiteswar kumar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: