Jira sends garbage in mails that are sent coinciding with a server shut-down

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Low
    • None
    • Affects Version/s: 4.3.4
    • Component/s: Email notifications
    • Environment:

      Centos 5.5, JDK 1.6.0_24

    • 4.03

      In the last two weeks with both Jira 4.2.2 and Jira 4.3.4, we've seen an issue where a user has received the following stacktrace in a mail from Jira:

      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 'getCustomFieldValue' in 
      class com.atlassian.jira.mail.TemplateIssue threw exception class java.lang.IllegalStateException : No implementation has been registered for this tenant, and there's no creator to create it at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:251) 
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175) 
      at org.apache.velocity.runtime.parser.node.ASTReference.evaluate(ASTReference.java:307) 
      at org.apache.velocity.runtime.parser.node.ASTExpression.evaluate(ASTExpression.java:45) 
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:68) 
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230) 
      at org.apache.velocity.runtime.directive.Parse.render(Parse.java:181) 
      at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114) 
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230) 
      at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:300) 
      at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:202) 
      at com.atlassian.velocity.DefaultVelocityManager.getEncodedBodyForContent(DefaultVelocityManager.java:143) 
      at com.atlassian.jira.mail.MailingListCompiler$1.processRecipient(MailingListCompiler.java:289) 
      at com.atlassian.jira.mail.NotificationRecipientProcessor.process(NotificationRecipientProcessor.java:39) 
      at com.atlassian.jira.mail.MailingListCompiler.addMailsToQueue(MailingListCompiler.java:311) 
      at com.atlassian.jira.mail.MailingListCompiler.access$400(MailingListCompiler.java:36) 
      at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.addEmailsToQueue(MailingListCompiler.java:456) 
      at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendLists(MailingListCompiler.java:426) 
      at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendForEvent(MailingListCompiler.java:379) 
      at com.atlassian.jira.mail.MailingListCompiler.sendLists(MailingListCompiler.java:129) 
      at com.atlassian.jira.mail.IssueMailQueueItem.send(IssueMailQueueItem.java:151) 
      at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66) 
      at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23) 
      at com.atlassian.jira.service.services.mail.MailQueueService.destroy(MailQueueService.java:43) 
      at com.atlassian.jira.service.JiraServiceContainerImpl.destroy(JiraServiceContainerImpl.java:96) 
      at com.atlassian.jira.upgrade.ConsistencyCheckImpl.destroy(ConsistencyCheckImpl.java:68) 
      at com.atlassian.jira.upgrade.ConsistencyLauncher.stop(ConsistencyLauncher.java:85) 
      at com.atlassian.jira.startup.DefaultJiraLauncher.stop(DefaultJiraLauncher.java:51) 
      at com.atlassian.jira.startup.LauncherContextListener$2.destroy(LauncherContextListener.java:69) 
      at com.atlassian.jira.startup.LauncherContextListener$2.destroy(LauncherContextListener.java:62) 
      at com.atlassian.multitenant.impl.MultiTenantComponentMapImpl.onTenantStop(MultiTenantComponentMapImpl.java:177) 
      at com.atlassian.multitenant.impl.DefaultMultiTenantManager$2.consume(DefaultMultiTenantManager.java:169) 
      at com.atlassian.multitenant.impl.DefaultMultiTenantManager$2.consume(DefaultMultiTenantManager.java:164) 
      at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForEachListener(DefaultMultiTenantManager.java:256) 
      at com.atlassian.multitenant.impl.DefaultMultiTenantManager.stopTenant(DefaultMultiTenantManager.java:163) 
      at com.atlassian.multitenant.impl.DefaultMultiTenantManager.stopAll(DefaultMultiTenantManager.java:211) 
      at com.atlassian.jira.startup.LauncherContextListener.contextDestroyed(LauncherContextListener.java:136) 
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244) 
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879) 
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106) 
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106) 
      at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
      at org.apache.catalina.core.StandardService.stop(StandardService.java:604) 
      at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788) 
      at org.apache.catalina.startup.Catalina.stop(Catalina.java:662) 
      at org.apache.catalina.startup.Catalina.start(Catalina.java:629) 
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
      at java.lang.reflect.Method.invoke(Method.java:597) 
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      

      The reason it happened is pretty obvious. The server was in the process of shutting down on both occasions.
      I think Jira should be a little smarter, and do one of two things:
      1. If a shutdown signal is received by Jira, place all mail in the queue instead of sending, and flush the queue on Jira startup
      2. Ignore the mail completely

            Assignee:
            Unassigned
            Reporter:
            David Corley
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: