Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-67475

Mail Handler creating duplicated tickets

    XMLWordPrintable

Details

    Description

      Status Update 3rd Jan 2018

      An first version of the fix for this issue was released on the 15th of December. However, this has been reverted back due to some undesired side-effects.

      We are currently investigating what caused the side-effects. A second version of the fix will be released asap.
      _____

      Summary

      Mail handlers are creating duplicated tickets. It seems like what happens is:

       

      • The mail handler starts processing a big message, (a big one or one with attachments for example).
      • The mail handler takes longer than the configured delay to finish processing this message. The default delay is 1 minute.
      • When the configured delay finishes, the mail handler accesses the mail box and starts processing the same message again.
      • It happens because JIRA didn’t finish processing the message in the first time and due to this the message was not deleted yet.

      Steps to Reproduce

      1. Send an email with attachments to a mail handler with the default timeout (1 min)

      Expected Results

      The mail handler should process this email and create 1 issue with it

      Actual Results

      The connection to the mail server closes before the handler is done processing the email. Therefore that email is not removed from the mail server and at the next run the handler will process the same email again, creating duplicated issues.

      The below lines are found in the logs:

      ERROR   com.atlassian.mail.incoming.mailfetcherservice  MAIL_HANDLER_NAME: The connection is no longer open, messages marked as deleted will not be purged from the remote server: imap.gmail.com until the next run.           
      
      2017-09-27 22:48:36.967 ERROR   com.atlassian.mail.incoming.mailfetcherservice  MAIL_HANDLER_NAME: The folder has been closed on us, stop processing any more emails: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out        * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out       javax.mail.FolderClosedException: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out
      at com.sun.mail.imap.IMAPMessage.loadFlags(IMAPMessage.java:1557)
      at com.sun.mail.imap.IMAPMessage.isSet(IMAPMessage.java:1021) 
      ......
      

      Notes

      This issue has multiple root-causes and it is not necessarily caused by emails bigger than 10MB. It is enough that the email handler is not done processing the incoming emails within the configured time interval.

      Currently we fixed the timeout that was closing the connection before the handler is done processing so now this issue should occur less often. Once we will also fix the other cause (emails too big) then we will mark this bug a resolved. 

      Workaround

      Attachments

        Issue Links

          Activity

            People

              kliu@atlassian.com Kenneth
              aradmann aradmann (Inactive)
              Votes:
              20 Vote for this issue
              Watchers:
              79 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: