Broken email notification due to corrupted work directory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The rendering of a notification email is broken and the following or similar stack-trace appears in the body of a JIRA notification email.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'diff' in class com.atlassian.jira.mail.DiffUtils threw exception java.lang.NullPointerException at templates/email/html/includes/fields/worklogchanges.vm[line 44, column 29]  at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)  at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284)  at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)  at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)  at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)  at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)  at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)  at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)  at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)  at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)  at org.apache.velocity.runtime.directive.Parse.render(Parse.java:263)  at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)  at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)  at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)  at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)  at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)  at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)  at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)  at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219)  at com.atlassian.velocity.JiraVelocityManager.getEncodedBodyForContent(JiraVelocityManager.java:81)  at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asHtml(DefaultVelocityTemplatingEngine.java:112)  at com.atlassian.jira.mail.MailingListCompiler$1.processRecipient(MailingListCompiler.java:312)  at com.atlassian.jira.mail.NotificationRecipientProcessor.process(NotificationRecipientProcessor.java:39)  at com.atlassian.jira.mail.MailingListCompiler.addMailsToQueue(MailingListCompiler.java:342)  at com.atlassian.jira.mail.MailingListCompiler.access$400(MailingListCompiler.java:48)  at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.addEmailsToQueue(MailingListCompiler.java:500)  at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendLists(MailingListCompiler.java:470)  at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendForEvent(MailingListCompiler.java:423)  at com.atlassian.jira.mail.MailingListCompiler.sendLists(MailingListCompiler.java:121)  at com.atlassian.jira.mail.IssueMailQueueItem.send(IssueMailQueueItem.java:149)  at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66)  at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:28)  at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)  at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:47)  at org.quartz.core.JobRunShell.run(JobRunShell.java:195)  at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)  at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)  Caused by: java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140)  at java.util.regex.Matcher.reset(Matcher.java:291)  at java.util.regex.Matcher.<init>(Matcher.java:211)  at java.util.regex.Pattern.matcher(Pattern.java:888)  at com.atlassian.diff.WordLevelDiffer.tokenize(WordLevelDiffer.java:153)  at com.atlassian.diff.WordLevelDiffer.diffLine(WordLevelDiffer.java:72)  at com.atlassian.diff.DiffViewBean.createWordLevelDiff(DiffViewBean.java:123) at com.atlassian.jira.mail.DiffUtils.diff(DiffUtils.java:23)  at sun.reflect.GeneratedMethodAccessor1575.invoke(Unknown Source)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)  at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:381)  at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:370)  at com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:30) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)  ... 36 more

Cause

Could be caused by a security level that was removed JRACLOUD-66537 - Email notification on Comment Edited event contains a stack trace exception if the comment previously had a security level applied and the recipient of the email couldn't view the original comment

A work log edit JRASERVER-42384 - Exception Notification Email Error when Editing Worklog Comment for Oracle DB

Or other unknown work log related actions.

Resolution

Force re-build the content of the Tomcat's work directory

  1. Shutdown JIRA

  2. Remove the contents of $JIRA-INSTALL/work directory

  3. Restart JIRA.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.