2
votes

I'm trying to configure some features in Jenkins for our project. In the process of configuring Editable Email Notification, I have created a new jelly script file in $JENKINS_HOME/email-templates folder as shown here

enter image description here

and accessing it in Jenkins config like this

enter image description here

When I build the job, with these setting, I'm getting email with the content "JellyException: Could not parse Jelly script : null"

Thanks in advance!!

2
this exception means about syntax error in your script, please post it hereStan E
I have the same problem. Using a working html.jelly script is ok. If I copy the working html.jelly to html2.jelly and make no changes I get the "JellyException: Could not parse Jelly script : null" error. How can we debug ? Where can jelly logs be enabled/found ?gaoithe

2 Answers

1
votes

I faced a similar issue after I updated my Jenkins installation. I used the "Email Template Testing" feature to verify my script, but kept getting

JellyException: Could not parse Jelly script : null

In my case the issue was caused because of the use of jelly:util library in my jelly script. The script used u:loadText and u:file tags.

It seems that newer version of Jenkins do not include the jelly:util library, required for using the util tags. I resolved the issue by manually placing the commons-jelly-tags-util-1.1.1.jar file in the \war\WEB-INF\lib directory of Jenkins and restarting it.

0
votes

There are two issues that are usually encountered when working with email templates (and there is another issue#2.5 will i'll explain as well :) )

  1. I faced this issue when I copied/created new scripts from a different user rather than the one that Jenkins uses to run as. So in this case if 'ubuntu' is not the user that runs Jenkins as well, consider chowning the file and group to the user/group of jenkins user.
  2. There were times when my jelly actually had an error which could not let it be parsed. I came to know about it from using the 'Email Template Testing' option available in the job options, which resulted in the same error

Now for the 2.5 issue

2.5. Please be cognizant of the fact that jelly templates have a different placeholder than the template-email-templates.

The '.template' files are loaded using ${SCRIPT} and '.jelly' Jelly scripts are loaded using ${JELLY_SCRIPT} tags, if you use JELLY_SCRIPT tag to load a template, you might end up with the same error as well. This point is naive but it's worth listing it here so that anyone with this issue has all the checkpoints required to fix this issue.