Jira stops processing incoming mail with MessageRemovedException errors in logs
Symptoms
Mail-based issue creation and/or adding comments to existing issues is failing. This may be occurring intermittently or entirely and may not correspond with any changes to the email server or IMAP/POP inbound email settings within JIRA.
The following errors appear in the catalina.out
and/or atlassian-jira-incoming-mail.log
:
IMAP Errors
MessageRemovedException
2014-12-17 12:02:42,663 atlassian-scheduler-quartz1.clustered_Worker-4 ERROR ServiceRunner SysOps Reply [atlassian.mail.incoming.mailfetcherservice] SysOps Reply[10121]: Exception: null
javax.mail.MessageRemovedException
at com.sun.mail.imap.IMAPMessage.forceCheckExpunged(IMAPMessage.java:224)
at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:1258)
at com.sun.mail.imap.IMAPMessage.getSubject(IMAPMessage.java:335)
at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:52)
Connection Timeout
javax.mail.MessagingException: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out;
nested exception is:
com.sun.mail.iap.ConnectionException: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out
at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:961)
POP Errors
MessageRemovedException
java.io.IOException: javax.mail.MessageRemovedException: can't retrieve message #1 in POP3Message.writeTo
at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:201)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:149)
Connection Timeout
javax.mail.AuthenticationFailedException: Read timed out
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:208)
at javax.mail.Service.connect(Service.java:295)
Cause
Contention is occurring while JIRA's mail handler is processing emails. This may happen because of:
- Multiple instances of JIRA processing incoming email from the same email inbox. This is most commonly seen when establishing a staging server environment for JIRA and similar circumstances.
- Multiple mail handlers have been configured to pull email from the same email inbox/folder.
Resolution
Cause 1
Disable inbound email processing for all but one instance of JIRA connected to the same email inbox:
or
Cause 2
Configure JIRA's mail handlers to process email from separate email inboxes or folders, as described in Creating Issues and Comments from Email to prevent contention.
Creating filters within your email inbox to automatically split inbound email to different folders may be helpful here. See Using Filters - Gmail for more information on this process within Gmail, as example.