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

Email extension templates not expanding environment variables

    • token-macro 2.14

      I have verified that this occurs when I upgrade Jenkins from 2.273 to 2.274. Up until that version, this works perfectly:

       

      From: jenkins_server06@pridedallas.com jenkins_server06@pridedallas.com
      Sent: Monday, January 18, 2021 6:59 PM
      To: # IT
      Subject: PHP-Master - Build # 202 - Successful!

       

      PHP-Master - Build # 202 - Successful: Check console output at http://jenkins.pridedallas.com:9999/job/PHP-Master/202/ to view the results.


      Now, I get this:

      From: jenkins_server06@pridedallas.com jenkins_server06@pridedallas.com
      Sent: Monday, January 18, 2021 7:21 PM
      To: # IT
      Subject: $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!

       

      $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: Check console output at $BUILD_URL to view the results.

       


      Windows Server 2019

       

          [JENKINS-64659] Email extension templates not expanding environment variables

          Basil Crow added a comment -

          It's unclear to me which of the three variables in the equation (Jenkins core version, Email Extension plugin version, and Email Extension Template version) is the one responsible for the problem. Can you please do some more work to isolate the problem to one specific component? For example, if you can reproduce the problem with Jenkins core 2.274, Email Extension 2.81, and Email Extension Template 1.2 but cannot reproduce the problem with Jenkins core 2.273, Email Extension 2.81, and Email Extension Template 1.2, then that would implicate Jenkins core.

          Basil Crow added a comment - It's unclear to me which of the three variables in the equation (Jenkins core version, Email Extension plugin version, and Email Extension Template version) is the one responsible for the problem. Can you please do some more work to isolate the problem to one specific component? For example, if you can reproduce the problem with Jenkins core 2.274, Email Extension 2.81, and Email Extension Template 1.2 but cannot reproduce the problem with Jenkins core 2.273, Email Extension 2.81, and Email Extension Template 1.2, then that would implicate Jenkins core.

          Basil Crow added a comment -

          The proximate cause of the problem is a change in Jenkins core between 2.273 and 2.274. The problem can be reproduced in in the Email Extension test suite by running mvn test -Djenkins.version=2.274 (mvn test -Djenkins.version=2.273 passes).

          The problem is not caused by Email Extension or Email Extension Template but rather by Token Macro. The stack trace is:

             8.281 [id=44]        SEVERE  h.p.e.plugins.ContentBuilder#transformText
          java.lang.IllegalStateException
                  at org.objectweb.asm.tree.analysis.BasicInterpreter.<init>(BasicInterpreter.java:66)
                  at org.parboiled.transform.RuleMethodInterpreter.<init>(RuleMethodInterpreter.java:42)
                  at org.parboiled.transform.InstructionGraphCreator.process(InstructionGraphCreator.java:41)
                  at org.parboiled.transform.ParserTransformer.runMethodTransformers(ParserTransformer.java:62)
                  at org.parboiled.transform.ParserTransformer.extendParserClass(ParserTransformer.java:45)
                  at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:39)
                  at org.parboiled.Parboiled.createParser(Parboiled.java:54)
          Caused: java.lang.RuntimeException: Error creating extended parser class: null
                  at org.parboiled.Parboiled.createParser(Parboiled.java:58)
                  at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:80)
                  at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:74)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:199)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:237)
                  at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:80)
                  at hudson.plugins.emailext.EmailRecipientUtils.getRecipientList(EmailRecipientUtils.java:211)
                  at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:949)
                  at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:511)
                  at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:446)
                  at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:354)
                  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
                  at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
                  at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
                  at hudson.model.Build$BuildExecution.cleanUp(Build.java:187)
                  at hudson.model.Run.execute(Run.java:1954)
                  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
                  at hudson.model.ResourceController.execute(ResourceController.java:97)
                  at hudson.model.Executor.run(Executor.java:429)
          

          I am reassigning this to Jenkins core and Token Macro to sort out what happened here. CC slide_o_mix markewaite

          Basil Crow added a comment - The proximate cause of the problem is a change in Jenkins core between 2.273 and 2.274. The problem can be reproduced in in the Email Extension test suite by running mvn test -Djenkins.version=2.274 ( mvn test -Djenkins.version=2.273 passes). The problem is not caused by Email Extension or Email Extension Template but rather by Token Macro. The stack trace is: 8.281 [id=44] SEVERE h.p.e.plugins.ContentBuilder#transformText java.lang.IllegalStateException at org.objectweb.asm.tree.analysis.BasicInterpreter.<init>(BasicInterpreter.java:66) at org.parboiled.transform.RuleMethodInterpreter.<init>(RuleMethodInterpreter.java:42) at org.parboiled.transform.InstructionGraphCreator.process(InstructionGraphCreator.java:41) at org.parboiled.transform.ParserTransformer.runMethodTransformers(ParserTransformer.java:62) at org.parboiled.transform.ParserTransformer.extendParserClass(ParserTransformer.java:45) at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:39) at org.parboiled.Parboiled.createParser(Parboiled.java:54) Caused: java.lang.RuntimeException: Error creating extended parser class: null at org.parboiled.Parboiled.createParser(Parboiled.java:58) at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:80) at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:74) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:199) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:237) at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:80) at hudson.plugins.emailext.EmailRecipientUtils.getRecipientList(EmailRecipientUtils.java:211) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:949) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:511) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:446) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:354) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752) at hudson.model.Build$BuildExecution.cleanUp(Build.java:187) at hudson.model.Run.execute(Run.java:1954) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) I am reassigning this to Jenkins core and Token Macro to sort out what happened here. CC slide_o_mix markewaite

          Mark Waite added a comment -

          Looks like the same message is reported in JENKINS-64636 and JENKINS-64730. In those cases, the solution seems to have been to update to token-macro 2.14 with its minimum dependency on Jenkins 2.274.

          Mark Waite added a comment - Looks like the same message is reported in JENKINS-64636 and JENKINS-64730 . In those cases, the solution seems to have been to update to token-macro 2.14 with its minimum dependency on Jenkins 2.274.

          Hudd Dust added a comment -

          Have this issue after upgrading from 2.266 to 2.274

          Hudd Dust added a comment - Have this issue after upgrading from 2.266 to 2.274

          Keith Davis added a comment - - edited

          I'm confused, both this issue and JENKINS-64757 are resolved as Duplicate.

          Keith Davis added a comment - - edited I'm confused, both this issue and  JENKINS-64757  are resolved as Duplicate .

          Mark Waite added a comment -

          laurin1 did you update the token-macro plugin to the most recent available release for the Jenkins version you are running?

          The Jenkins plugin manager currently needs the user to press "Check now" after an upgrade from a previous version (like 2.263) to a newer version (like 2.277). If you don't press the "Check now" button or wait the 24 or more hours for the clock based refresh, it will not show all available updates for the newer version. A Jenkins core pull request is being evaluated now to improve that behavior, but it has not arrived in any Jenkins core version yet.

          Mark Waite added a comment - laurin1 did you update the token-macro plugin to the most recent available release for the Jenkins version you are running? The Jenkins plugin manager currently needs the user to press "Check now" after an upgrade from a previous version (like 2.263) to a newer version (like 2.277). If you don't press the "Check now" button or wait the 24 or more hours for the clock based refresh, it will not show all available updates for the newer version. A Jenkins core pull request is being evaluated now to improve that behavior, but it has not arrived in any Jenkins core version yet.

          Keith Davis added a comment -

          No. I was holding off upgrades core and extensions until this was fixed as it's too hard to rollback. Nothing in this issue that I can see says that it's fixed.

          Keith Davis added a comment - No. I was holding off upgrades core and extensions until this was fixed as it's too hard to rollback. Nothing in this issue that I can see says that it's fixed.

          Keith Davis added a comment -

          Oh, you mean because of this:

          "In those cases, the solution seems to have been to update to token-macro 2.14 with its minimum dependency"

          I don't see how that is possible as I opened  this issue on 1/18 and 2.14 was released on 1/6.

           

          Keith Davis added a comment - Oh, you mean because of this: "In those cases, the solution seems to have been to update to token-macro 2.14 with its minimum dependency" I don't see how that is possible as I opened  this issue on 1/18 and 2.14 was released on 1/6.  

          Keith Davis added a comment -

          Ok, maybe you mean because of this?

           

          Keith Davis added a comment - Ok, maybe you mean because of this?  

          Keith Davis added a comment -

          Yea, that fixed it, thanks.

          Keith Davis added a comment - Yea, that fixed it, thanks.

            Unassigned Unassigned
            laurin1 Keith Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: