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 :) )
- 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.
- 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.