Uploaded image for project: 'Jira Service Management Cloud'
  1. Jira Service Management Cloud
  2. JSDCLOUD-6172

Emails with Large Size Attachments Fail To Generate Ticket in IMAP Mailbox

    XMLWordPrintable

Details

    Description

      Summary

      Emails sent to an IMAP custom Service Desk inbox with attachments bigger than 2Mb will not create a ticket in their JSD project. The email is read in the mailbox though but there is no record of JSD ever processing it. The issue is reproducible by the customer as the email is currently sitting in their inbox as read, and has been marked as unread several times. The email gets then marked as read with no success in creating the ticket in JSD.

      This issue may also present as delays in all of JSD’s custom mailbox pulling processes.

      Steps to Reproduce

      1. Setup custom secure IMAP mail server
      2. Receive an email with attachment of around 2Mb or larger
      3. Notice the email will be read, but no record is logged in Jira

      NOTE: This could not be reproduced in our Atlassian test environment.

      Expected Results

      1. Email is set with attachment
      2. Ticket is created and a log created in Jira

      Actual Results

      Email is marked as read but JSD ticket does not get generated and the following stack trace is found in the logs:

      com.sun.mail.util.FolderClosedIOException
      	at com.sun.mail.imap.IMAPInputStream.forceCheckExpunged(IMAPInputStream.java:107)
      	at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:158)
      	at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:218)
      	at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:244)
      	at com.sun.mail.imap.IMAPMessage.writeTo(IMAPMessage.java:849)
      	at com.atlassian.jira.internal.mail.processor.util.MimeMessageBase64ChunkStream.fullyLoadMessageToMemory(MimeMessageBase64ChunkStream.java:32)
      	at com.atlassian.jira.internal.mail.processor.util.MimeMessageBase64ChunkStream.<init>(MimeMessageBase64ChunkStream.java:22)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.createMailItemChunk(MailItemStore.java:237)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.lambda$null$2(MailItemStore.java:212)
      	at io.atlassian.fugue.Option.map(Option.java:259)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.lambda$createMailItem$3(MailItemStore.java:210)
      	at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl.lambda$execute$0(DatabaseAccessorImpl.java:51)
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:88)
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor$1.execute(DefaultTransactionalExecutor.java:42)
      	at com.atlassian.jira.internal.sal.rdbms.JiraHostConnectionAccessor.lambda$borrowConnectionAndExecute$0(JiraHostConnectionAccessor.java:62)
      	at com.atlassian.jira.database.DatabaseAccessorImpl.executeQuery(DatabaseAccessorImpl.java:36)
      	at com.atlassian.jira.internal.sal.rdbms.JiraHostConnectionAccessor.borrowConnectionAndExecute(JiraHostConnectionAccessor.java:50)
      	at com.atlassian.jira.internal.sal.rdbms.JiraHostConnectionAccessor.execute(JiraHostConnectionAccessor.java:40)
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.execute(DefaultTransactionalExecutor.java:39)
      	at com.atlassian.pocketknife.internal.querydsl.SalTransactionalExecutor.execute(SalTransactionalExecutor.java:21)
      	at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl.execute(DatabaseAccessorImpl.java:49)
      	at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl.runInTransaction(DatabaseAccessorImpl.java:35)
      	at com.atlassian.jira.internal.mail.processor.querydsl.QueryDslHelper.runInTransaction(QueryDslHelper.java:53)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.createMailItem(MailItemStore.java:206)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemManager.createMailItemFromMessage(MailItemManager.java:41)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.persistMailMessage(MailPullerWorker.java:256)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.pullEmailForConnection(MailPullerWorker.java:167)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.handlePullFromNormalMailConnection(MailPullerWorker.java:136)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.handlePullFromConnection(MailPullerWorker.java:105)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.pullEmailsForChannel(MailPullerWorker.java:92)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerWorker.pullMailFromAllValidChannels(MailPullerWorker.java:78)
      	at com.atlassian.jira.internal.mail.processor.feature.puller.MailPullerService.run(MailPullerService.java:48)
      	at com.atlassian.jira.internal.mail.processor.services.MailPullerExecutor.run(MailPullerExecutor.java:32)
      	at com.atlassian.jira.internal.mail.processor.services.AbstractMailExecutor.execute(AbstractMailExecutor.java:39)
      	at com.atlassian.jira.internal.mail.processor.services.MailJobRunner.runJob(MailJobRunner.java:39)
      	at com.atlassian.scheduler.cronman.service.ModeAwareJobWrapper.runJob(ModeAwareJobWrapper.java:50)
      	at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:195)
      	at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:168)
      	at com.atlassian.scheduler.core.JobLauncher.launchJob(JobLauncher.java:139)
      	at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:129)
      	at com.atlassian.scheduler.cronman.service.ScheduledJobMessageRunner.launch(ScheduledJobMessageRunner.java:93)
      	at com.atlassian.scheduler.cronman.service.ScheduledJobMessageRunner.lambda$processMessage$0(ScheduledJobMessageRunner.java:60)
      	at java.util.Optional.ifPresent(Optional.java:159)
      	at com.atlassian.scheduler.cronman.service.ScheduledJobMessageRunner.processMessage(ScheduledJobMessageRunner.java:60)
      	at com.atlassian.messagequeue.internal.core.NestedMessageConsumer.consume(NestedMessageConsumer.java:135)
      	at com.atlassian.messagequeue.internal.sqs.SQSMessageConsumer.processReceiveMessageResult(SQSMessageConsumer.java:171)
      	at com.atlassian.messagequeue.internal.sqs.SQSMessageConsumer.run(SQSMessageConsumer.java:112)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      On that search, a warning message Could not acquire the CLUSTER_LOCK therefore the job will not be executed is shown in the logs 6 seconds before the error message triggers. This always happens for all the emails that failed to be processed.

      Notes

      • By looking at the connectivity logs for that inbox, we can see several of [AUTHENTICATIONFAILED] Invalid credentials (Failure) errors in the last month. Related bug JSDCLOUD-5988: Connectivity log displays "AUTHENTICATE failed" errors
      • Purged the inbox and cleared all existing emails leaving only the affected email as unread
      • Forward the email directly to the default Jira inbox, a ticket was created

      Workaround

      Forward mail to the default mail address for the Service Desk project

      • Be aware of the need to pass SPF checks for forwarding set-up
      • Ensure that the forwarding method doesn’t add an “Auto-Submitted” header

      Attachments

        Issue Links

          Activity

            People

              jsheehy J Sheehy
              nsilvaratnam Niro (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: