Mails not leaving mail queue

Global Agile Development Inc September 12, 2013

Hello,

I have a problem with jira, I'm using Version of JIRA (v6.0.7#6106-sha1:76d7c58) everything seams to be working fine on my server the test email works but

Mail Messages seems to be getting stuck in the Mail Queue if flush it all the emails are sent but dose not by it self

please help....

:)

Vatsal


6 answers

1 accepted

8 votes
Answer accepted
AlaA
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.
September 17, 2013

Hey vastal,

This problem is quite common, and the root cause of the problme may vary a lot from instance to another instance. Before trying any hands-on solutions, can you try to perform the following and check whether the problem still persists:

# Shut down JIRA

# Delete the content of {{$JIRA_INSTALL/work}} directory

# Delete the content of {{$JIRA_HOME/caches/indexes}} directory

# Delete the content of {{$JIRA_HOME/plugins/.bundled-plugins}} directory

# Delete the content of {{JIRA_HOME/plugins/.osgi-plugins}} directory

# Start-up JIRA

# Perform indexing (System > Advanced > Indexing)

Hope that helps.

Quyet Le March 25, 2014

Thanks Ala. This resolved our mail queue blocking issue and really needs to be added as a first step to try in this knowledge base page -https://confluence.atlassian.com/display/JIRAKB/Mail+Queue+Never+Flushed+Automatically

Alexander Kho May 21, 2014

nice, this solution solve my issue too

Gregory Hicks October 21, 2014

solved my issue! excellent post my friend :).

Mario Rowies February 16, 2015

solved my issue too! Thank you!

Liam_Wickins February 8, 2016

The third step of this advice rendered my JIRA instance in a state where I was unable to re-build the indexes.  Fortunately I had made a back-up of the indexes directory and so was able to restore them to their previous state.

Nabil Assi October 3, 2016

After restart the notification queue keeps growing. This procedure did not solve the issue for me and i am running JIRA version 7.1.9.

gkohli September 12, 2017

It works for me, But I was only havng  {{$JIRA_INSTALL/work}} directory

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
Bruno Litman March 31, 2014

We are having the same exact issue in our onDemand instance - this problem started very recently

our version of jira is listed as

JIRA v6.3-OD-01-067

Is there an open support ticket that we can add our vote and voice to?

Thank you

AlaA
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.
March 31, 2014

Bruno,

There was a bug with the latest deployment of OnDemand instances. However, the fix for the outgoing mail problem has already been rolled out, so it should be fixed by now on your instance. However, if you are still facing the problem, please do not hesitate to let us know on our Support system.

-Ala

0 votes
Georgios Dimoulis March 30, 2014

Hi all,

I have the same issue. However I am currently using the Jira OnDemand solution and don't know what to do now.

I saw that Jiro got updated yesterday to the 6.3 Version.

Can anyone help please??

Thank in advance,
Georgios Dimoulis

AlaA
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.
March 30, 2014

Hello Georgios,

If you hit into thi problem in your OnDemand instance, there is, I'm afraid, a little you can do from your side. The best way is to create a support ticket in our OnDemand support Project, and our engineers will look into the issue.

Regards,

Ala

0 votes
Andy Brook [Plugin People]
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.
September 13, 2013

As Timothy says logging protocol details will likely show up the problem.

In the outbound mail server, if you can send a test mail you can validate your outbound smtp settings. If that doesnt work you have a user auth / server connectivity configuration problem.

If that works, a common reason for this is that you have defined a per-project custom from: address that is not the same as your smtp outbound server. Check projects involved, clear the default from: address to rule it out; Mail servers usually restrict what address you can send 'from' as its possibly a spamming vector. If you have a mailserver that does bad things like reject mail outright (Exchange does this) then you get your symptoms. Servers like Gmail rewrite the from: address to the outbound smtp address.

Past that, info from the logs will inform better answers

0 votes
Timothy
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.
September 12, 2013

Suggest an answer

Log in or Sign up to answer