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

Cannot use Jelly Template after recent 2.40 fix

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • email-ext-plugin
    • None
    • Jenkins LTS 1.596.2, Plugin 2.40.1

    Description

      When using ${JELLY_SCRIPT,template="mod1.template"} I get the error that was reported about Groovy scripts for Jenkins-28202, Jelly file [mod1.template] was not found in $JENKINS_HOME/email-templates

      Nothing was changed in my environment and the file was used fine before. The file does exist and has the full filename of mod1.template.jelly but now it won't work.
      Doing a Test email and putting the full filename there it does find it in the correct location it is only when a build fires it off that this is failing.

      Attachments

        1. email-ext.hpi
          5.94 MB
        2. email-ext.jpi
          5.94 MB

        Issue Links

          Activity

            slide_o_mix Alex Earl added a comment -

            Ok, I'll look into this ASAP.

            slide_o_mix Alex Earl added a comment - Ok, I'll look into this ASAP.
            slide_o_mix Alex Earl added a comment - - edited

            I'm actually not able to reproduce this. I put my template into email-templates and set the content to

            ${JELLY_SCRIPT, template="module1.template"}
            
            slide_o_mix Alex Earl added a comment - - edited I'm actually not able to reproduce this. I put my template into email-templates and set the content to ${JELLY_SCRIPT, template= "module1.template" }
            slide_o_mix Alex Earl added a comment -

            Did you restart Jenkins after upgrading email-ext?

            slide_o_mix Alex Earl added a comment - Did you restart Jenkins after upgrading email-ext?
            jstarbird Jon Starbird added a comment -

            yes I did. I'm just about to test again on a blank job so let me see what happens. Before I had only tried the Test Template.

            jstarbird Jon Starbird added a comment - yes I did. I'm just about to test again on a blank job so let me see what happens. Before I had only tried the Test Template.
            jstarbird Jon Starbird added a comment -

            So I tried a blank job and it still doesn't find the file.
            Rebooted the server completely, still doesn't work.
            Added a line to print the JENKINS_HOME into the email and it shows the Correct Jenkins path where my email-templates folder and the file lives.

            jstarbird Jon Starbird added a comment - So I tried a blank job and it still doesn't find the file. Rebooted the server completely, still doesn't work. Added a line to print the JENKINS_HOME into the email and it shows the Correct Jenkins path where my email-templates folder and the file lives.
            jstarbird Jon Starbird added a comment -

            is it expecting the Extension in a particular Case?

            jstarbird Jon Starbird added a comment - is it expecting the Extension in a particular Case?
            jstarbird Jon Starbird added a comment -

            So I put the .jelly extension in the call, so ${JELLY_SCRIPT,template="mod1.template.jelly"}
            and then it worked. So for some reason it's not adding the extension like it used to.

            jstarbird Jon Starbird added a comment - So I put the .jelly extension in the call, so ${JELLY_SCRIPT,template="mod1.template.jelly"} and then it worked. So for some reason it's not adding the extension like it used to.
            slide_o_mix Alex Earl added a comment -

            Can you verify you are on 2.40.1? This sounds more like 2.40. I can't replicate this at all with 2.40.1 with a similar setup.

            slide_o_mix Alex Earl added a comment - Can you verify you are on 2.40.1? This sounds more like 2.40. I can't replicate this at all with 2.40.1 with a similar setup.
            jstarbird Jon Starbird added a comment -

            Yep. At least that's what Jenkins is saying it is. Even have a Downgrade to 2.40 button.
            Let me try downgrading and then re-upgrade.

            jstarbird Jon Starbird added a comment - Yep. At least that's what Jenkins is saying it is. Even have a Downgrade to 2.40 button. Let me try downgrading and then re-upgrade.
            jstarbird Jon Starbird added a comment -

            Nope. Downgraded to 2.40 and then upgraded back to 2.40.1 and still can't handle it without the extension being included.

            jstarbird Jon Starbird added a comment - Nope. Downgraded to 2.40 and then upgraded back to 2.40.1 and still can't handle it without the extension being included.
            slide_o_mix Alex Earl added a comment -

            Can you upload email-ext.jpi from JENKINS_HOME/plugins?

            slide_o_mix Alex Earl added a comment - Can you upload email-ext.jpi from JENKINS_HOME/plugins?
            jstarbird Jon Starbird added a comment -

            I will do that right now. Just wanted to add, I have another server that I had NOT updated to 2.40.1, so it's still at 2.40, and on that one I do not have this problem at all. So it does seem to be in 2.40.1.
            I'll upload the file shortly.

            jstarbird Jon Starbird added a comment - I will do that right now. Just wanted to add, I have another server that I had NOT updated to 2.40.1, so it's still at 2.40, and on that one I do not have this problem at all. So it does seem to be in 2.40.1. I'll upload the file shortly.
            slide_o_mix Alex Earl added a comment -

            Even using the jpi that you provided, I can't replicate this issue. I downloaded Jenkins 1.613 and ran it standalone (java -jar jenkins.war), then took the jpi file you provided and uploaded it into the Jenkins instance via the advanced tab. Then I put a template called "mod1.template" in the JENKINS_HOME/email-templates directory. In the default content field for the job, I put

            ${JELLY_SCRIPT, template="mod1.template"}
            

            The email was generated correctly based on the contents of the the Jelly based template.

            slide_o_mix Alex Earl added a comment - Even using the jpi that you provided, I can't replicate this issue. I downloaded Jenkins 1.613 and ran it standalone (java -jar jenkins.war), then took the jpi file you provided and uploaded it into the Jenkins instance via the advanced tab. Then I put a template called "mod1.template" in the JENKINS_HOME/email-templates directory. In the default content field for the job, I put ${JELLY_SCRIPT, template= "mod1.template" } The email was generated correctly based on the contents of the the Jelly based template.
            jstarbird Jon Starbird added a comment -

            Well I'm on 1.596.2, not sure why that would matter though.

            Any ideas what could be causing the issue? Fortunately I have a work around now, just putting the extension in, but it would be good for all of us if we found the cause.
            Anything else I can provide to help? I bumped the Priority down to Major since there is a work around for this.

            jstarbird Jon Starbird added a comment - Well I'm on 1.596.2, not sure why that would matter though. Any ideas what could be causing the issue? Fortunately I have a work around now, just putting the extension in, but it would be good for all of us if we found the cause. Anything else I can provide to help? I bumped the Priority down to Major since there is a work around for this.
            slide_o_mix Alex Earl added a comment -

            What OS are you running on? Perhaps that could make a difference in the way the code works.

            slide_o_mix Alex Earl added a comment - What OS are you running on? Perhaps that could make a difference in the way the code works.
            jstarbird Jon Starbird added a comment -

            This particular one is Windows 7 Ultimate.
            Another one is on Windows 7 Pro with the same Jenkins version but only 2.40 of the plugin, on that one it still works without the extension but I'm not on the 2.40.1.

            jstarbird Jon Starbird added a comment - This particular one is Windows 7 Ultimate. Another one is on Windows 7 Pro with the same Jenkins version but only 2.40 of the plugin, on that one it still works without the extension but I'm not on the 2.40.1.
            slide_o_mix Alex Earl added a comment -

            I'm not sure where to go on this one. I can't replicate it at all, even using the jpi file you provided. Maybe a remote screen sharing or something?

            slide_o_mix Alex Earl added a comment - I'm not sure where to go on this one. I can't replicate it at all, even using the jpi file you provided. Maybe a remote screen sharing or something?
            slide_o_mix Alex Earl added a comment -

            I tried with 1.596.2 as well with your jpi, and I didn't have any issues still.

            slide_o_mix Alex Earl added a comment - I tried with 1.596.2 as well with your jpi, and I didn't have any issues still.
            jstarbird Jon Starbird added a comment -

            I'm not sure where to go next either. Unfortunately company policy prevents me from sharing desktop to an outside entity. I can provide any additional info you think might help.
            Java version is 1.7, OS is recently updated - like in the last 2 months, do you want a list of all the other plugins?

            One question, you mentioned before that 2.40 was having the issue of needing the extension but that was for only Groovy, correct? Just wondering why my other system running 2.40 and was never upgraded to 2.40.1, doesn't see the issue.

            jstarbird Jon Starbird added a comment - I'm not sure where to go next either. Unfortunately company policy prevents me from sharing desktop to an outside entity. I can provide any additional info you think might help. Java version is 1.7, OS is recently updated - like in the last 2 months, do you want a list of all the other plugins? One question, you mentioned before that 2.40 was having the issue of needing the extension but that was for only Groovy, correct? Just wondering why my other system running 2.40 and was never upgraded to 2.40.1, doesn't see the issue.
            slide_o_mix Alex Earl added a comment -

            Yes, there was a change that went into 2.40 that would have caused the issue for either Jelly or Groovy. The fix went into 2.40.1. I decompiled the plugin file you uploaded, and the code is correct, it wouldn't require the .jelly to be added at the end, so I don't know how it's causing you an issue, unless somehow your plugin versions are showing up incorrectly, but I don't know how that is possible either. Are you running Jenkins in Tomcat or anything like that, or just as java -jar jenkins.war?

            slide_o_mix Alex Earl added a comment - Yes, there was a change that went into 2.40 that would have caused the issue for either Jelly or Groovy. The fix went into 2.40.1. I decompiled the plugin file you uploaded, and the code is correct, it wouldn't require the .jelly to be added at the end, so I don't know how it's causing you an issue, unless somehow your plugin versions are showing up incorrectly, but I don't know how that is possible either. Are you running Jenkins in Tomcat or anything like that, or just as java -jar jenkins.war?
            jstarbird Jon Starbird added a comment -

            It's running as java -jar . Interestingly on both of these machines I was no longer getting the Upgrade message for Jenkins itself within Jenkins for this last update to 1.596.2 so I had to manually download the war files and upgrade that way.
            After that I upgraded all the plugins that needed upgrading, but I did that the normal way from within Jenkins.
            My point is that the upgrade to 2.40 happened at the time I did that. No idea what connection could be there but just wanted to mention it since it was an odd situation for the Upgrade notice to not show up in Jenkins.

            jstarbird Jon Starbird added a comment - It's running as java -jar . Interestingly on both of these machines I was no longer getting the Upgrade message for Jenkins itself within Jenkins for this last update to 1.596.2 so I had to manually download the war files and upgrade that way. After that I upgraded all the plugins that needed upgrading, but I did that the normal way from within Jenkins. My point is that the upgrade to 2.40 happened at the time I did that. No idea what connection could be there but just wanted to mention it since it was an odd situation for the Upgrade notice to not show up in Jenkins.
            slide_o_mix Alex Earl added a comment -

            Wait, I think I misunderstood something, is the file named mod1.template.jelly on the file system itself?

            slide_o_mix Alex Earl added a comment - Wait, I think I misunderstood something, is the file named mod1.template.jelly on the file system itself?
            jstarbird Jon Starbird added a comment -

            Yes. Then I was entering in the email settings as ${JELLY_SCRIPT, template="mod1.template"} until I updated to 2.40.1 but the file in email-templates folder has always had the full name with extension.

            jstarbird Jon Starbird added a comment - Yes. Then I was entering in the email settings as ${JELLY_SCRIPT, template="mod1.template"} until I updated to 2.40.1 but the file in email-templates folder has always had the full name with extension.
            slide_o_mix Alex Earl added a comment -

            Ok, I had misunderstood that part. I know why this is happening and can reproduce the problem and should have a fix soon. Sorry for the runaround!

            slide_o_mix Alex Earl added a comment - Ok, I had misunderstood that part. I know why this is happening and can reproduce the problem and should have a fix soon. Sorry for the runaround!
            jstarbird Jon Starbird added a comment -

            No problem. Glad it got figured out.

            jstarbird Jon Starbird added a comment - No problem. Glad it got figured out.
            slide_o_mix Alex Earl added a comment -

            If you are willing, can you try the version I attached? You'll have to install via the advanced area in the plugin manager.

            slide_o_mix Alex Earl added a comment - If you are willing, can you try the version I attached? You'll have to install via the advanced area in the plugin manager.
            jstarbird Jon Starbird added a comment -

            Yep that fixes the issue.

            jstarbird Jon Starbird added a comment - Yep that fixes the issue.
            slide_o_mix Alex Earl added a comment -

            Great, I'll be releasing a 2.40.3 soon if I can get another fix checked.

            slide_o_mix Alex Earl added a comment - Great, I'll be releasing a 2.40.3 soon if I can get another fix checked.

            Code changed in jenkins
            User: Alex Earl
            Path:
            src/main/java/hudson/plugins/emailext/plugins/content/AbstractEvalContent.java
            http://jenkins-ci.org/commit/email-ext-plugin/f72f226f83ffe6f06e38de00829b1db6e093af61
            Log:
            Fix JENKINS-28357

            If template doesn't exist, try with extension added.

            Compare: https://github.com/jenkinsci/email-ext-plugin/compare/2b0a93e32399...f72f226f83ff

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/content/AbstractEvalContent.java http://jenkins-ci.org/commit/email-ext-plugin/f72f226f83ffe6f06e38de00829b1db6e093af61 Log: Fix JENKINS-28357 If template doesn't exist, try with extension added. Compare: https://github.com/jenkinsci/email-ext-plugin/compare/2b0a93e32399...f72f226f83ff
            jstarbird Jon Starbird added a comment -

            btw Alex, huge thanks for jumping on this so quick! Great to see folks respond quickly to these open source projects, not all do.
            I know initially this was marked as a blocker issue but you kept at it even once a work around was achieved. So thanks for doing that.

            jstarbird Jon Starbird added a comment - btw Alex, huge thanks for jumping on this so quick! Great to see folks respond quickly to these open source projects, not all do. I know initially this was marked as a blocker issue but you kept at it even once a work around was achieved. So thanks for doing that.
            slide_o_mix Alex Earl added a comment -

            Glad to help!

            slide_o_mix Alex Earl added a comment - Glad to help!
            slide_o_mix Alex Earl added a comment -

            Resolved with 2.40.3

            slide_o_mix Alex Earl added a comment - Resolved with 2.40.3

            People

              slide_o_mix Alex Earl
              jstarbird Jon Starbird
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: