Jira mail queue stops periodically and have to reboot jira and / or manually flush queue

Kevin Smith123 January 7, 2013

After 24 to 36 hours uptime the Jira mail queue stops. If I manually flush the queue it does send the mails but gets stuck again straight away.

3 answers

1 accepted

0 votes
Answer accepted
Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2013

This happen mostly due to Out of memory errors. Search for outofmemory on stdout log file.

You may treat the symptom by increasing the java heap space memory. But that would be a temporary solution.

You need to investigate on the root cause. The most common possibilities are:

1. 3rd party plugins

2. Custom services

3. XML back-up sucks a lot of memory if the production instance is huge

Also consider visiting this URL for more information.

https://confluence.atlassian.com/pages/viewpage.action?pageId=191069

Rahul

John Garcia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 9, 2013

In addition, intermittent network failures can cause this. Try using BigBrother, NewRelic, or similar to monitor the server's connectivity.

0 votes
Patrick S
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2018

I just spent way too much time fixing this on our JSD instance, so I'm publishing this answer on every article that seems related in case it saves others time.

This answer does involve some database manipulation (the email queue is stored in AO_4E8AE6_NOTIF_BATCH_QUEUE), which I know is frowned upon, but it was the only thing that worked after trying every other solution I found (clearing caches, changing ntp, trying safe mode, etc).

  1. Take note of the emails that are failing to send. This will be obvious in the Mail Queue (Admin Cog → System → Mail Queue).

    1. -- AO_4E8AE6_NOTIF_BATCH_QUEUE is where the mail queue is stored in the database
      -- This will return the matching emails in the database
      select
      -- Join the project key on the issue number to get something the issueKey <PROJ-325>
      distinct p.pkey + '-' + cast(i.issuenum as varchar) as issueKey
      -- AO_4E8AE6_NOTIF_BATCH_QUEUE is the table that stores the pending notifications. This is the email queue!
      from JIRAServiceDesk.jiraschema.AO_4E8AE6_NOTIF_BATCH_QUEUE as q
      left join jiraschema.jiraissue i on i.id = q.ISSUE_ID
      left join jiraschema.project p on p.id = i.PROJECT
  2. Stop the JIRA website
  3. Delete all indexes
    1. rm {JIRA-HOME}/caches/indexes/* -f -R
  4. Backup the records that are failing to send for safe-keeping in SQL server
    1. select q.*
      into JIRAServiceDesk.jiraschema.[AO_4E8AE6_NOTIF_BATCH_QUEUE-BACKUP_BEFORE_CLEARING_QUEUE]
      from JIRAServiceDesk.jiraschema.AO_4E8AE6_NOTIF_BATCH_QUEUE as q
      where q.SENT_TIME is null
  5. Set the SENT_TIME on the stuck notifications so they don't try to send again.
    1. update JIRAServiceDesk.jiraschema.AO_4E8AE6_NOTIF_BATCH_QUEUE
      set SENT_TIME = 1526297477500 -- UNIX time that wasn't used on any other issues
      where sent_time is null
  6. Start the Service Desk.
  7. Confirm that the Mail Queue is empty in the  (Admin Cog → System → Mail Queue).
  8. Run a Locked index to rebuild the ones we deleted (Admin Cog → System → Indexing → Lock JIRA and rebuild index)
  9. Continue to monitor the Mail Queue as Customer Notifications should be sent out.
0 votes
darylchuah
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2013

Hi Kevin

There is a knowledge base article regarding on this issue : https://confluence.atlassian.com/display/JIRAKB/Mail+Queue+Never+Flushed+Automatically

Hope it helps :)

Suggest an answer

Log in or Sign up to answer