Issue Details (XML | Word | Printable)

Key: JRA-7295
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dylan Etkin [Atlassian]
Reporter: Tom Herrmann
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
JIRA

Flush mail queue and new notifications don't not work after some time, but send test mail works fine

Created: 12/Jul/05 05:04 AM   Updated: 30/Jul/06 07:36 PM
Component/s: Email integration
Affects Version/s: 3.2.2
Fix Version/s: 3.3 Beta1

Time Tracking:
Not Specified

File Attachments: 1. GZip Archive jira-logs.tar.gz (2 kB)
2. Zip Archive logs-20050715.zip (3 kB)

Environment: Mail Server is MS Exchange
Issue Links:
Reference
 

Participants: Anton Mazkovoi [Atlassian], Dylan Etkin [Atlassian], Jeff Turner [Atlassian], Joshua Spiewak and Tom Herrmann
Since last comment: 3 years, 18 weeks, 5 days ago
Resolution Date: 26/Jul/05 06:40 PM
Labels:


 Description  « Hide
For some time Mail works fine. After some day (sometimes some hours) email notifications are not beeing sent anymore. Flush mail queue does not work too. Sending a test eMail works. After restarting JIRA everything is OK (for the next hours or days), but all queued mails are lost!

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner [Atlassian] added a comment - 14/Jul/05 01:10 AM
Please could you attach the JIRA logs. There is generally something in there indicating why the mail queue is hung.

Tom Herrmann added a comment - 14/Jul/05 02:02 AM
Here are the logs after a restart. Flushing eMail still does not work and no mails are sent automaticly, but sending a test mail works fine.

Joshua Spiewak added a comment - 14/Jul/05 10:07 AM
I just ran into this as well with 3.2.1 Ent. The only relavent information in the log is from seven days before the first message in the mail queue:

2005-06-30 08:25:37,840 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='fperez@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<9840044.1119972489794.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more
2005-06-30 08:27:37,733 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='fperez@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<9840044.1119972489794.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more
2005-06-30 08:27:58,736 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='hmalin@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<25168662.1119972489591.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more
2005-06-30 08:28:19,739 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='fperez@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<9840044.1119972489794.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more
2005-06-30 08:30:37,681 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='fperez@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<9840044.1119972489794.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more
2005-06-30 08:30:58,684 ERROR [atlassian.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='hmalin@amicas.com' Subject='Commented: (RIS-2820) Exams with procedures that can be scheduled in different resources =- the Monitors show the exam in the incorrect resource' From='ascott@amicas.com' FromName='Franklin Perez (JIRA)' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='<25168662.1119972489591.JavaMail.SYSTEM@jira>' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:160)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:47)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:55)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:59)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mailman.amicas.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at alt.javax.mail.TransportImpl.send(TransportImpl.java:18)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:146)
... 7 more


Anton Mazkovoi [Atlassian] added a comment - 14/Jul/05 10:25 PM
Tom,

Thank you for the log files. I believe they cover the period of time after JIRA has been restrated. Is this so? Next time the problem occurs would you be able to send us the log files taht have been generated before JIRA has been bounced.

Joshua,

Also thank you for the logs. I beleive all these problem occur due to the fact that the netwrok connecting JIRA to the SMTP server goes doen, or the SMTP server itself.

May I ask when this problem occurs if you go to Administartion -> System -> Mail Queue does the queue say that it is sending? For example does the screen say something like:
The mail queue is sending, it started sending at XXXXX.

Could you generate a thread dump before rebooting JIRA next time it runs? To generate a thread dump on linux/unix just do a 'kill -3 <pid>' on the JIRA process. On Windows to a CTR+Break on the command window (Tomcat's console). The thread dump shoudl go to the logs or the Tomcat's console. Please send it to us.

Thanks,.
Anton


Tom Herrmann added a comment - 15/Jul/05 08:20 AM
The attached logs now cover the period after a restart:
1. JIRA worked fine.

2. Maybe the connection to the SMTP server was not available for a short time

3. Notifications and flushing the mail queue don't work

4. Mail queue screen says :
This page shows you the current JIRA internal event queue, whose events may trigger notification emails.
The queue currently has 5 items in it.
The mail queue is sending, it started sending at .


Joshua Spiewak added a comment - 15/Jul/05 08:30 AM
Anton, I agree it looks like there might have been an SMTP server outage on 6/30. The earliest message in the mail queue was from 7/7 though. The Mail Queue page did not say that it was sending, and flushing the queue did not work. JIRA is running as a Windows service, I don't know of a way, off hand, of generating a thread dump in that situation.

Joshua Spiewak added a comment - 15/Jul/05 08:37 AM
I could be wrong about the Mail Queue page. Things look stuck again, and it does say "The queue currently has 20 items in it. The mail queue is sending, it started sending at ." The logs do not contain anything looking like the previous SMTP connection errors. In fact, they contain very little beyond a database connection hiccup.

Joshua Spiewak added a comment - 15/Jul/05 08:55 AM

Anton Mazkovoi [Atlassian] added a comment - 18/Jul/05 04:58 AM
Hi,

Thanks you for the details.

I believe this problem occurs due to the fact that JIRA does not set a connection timeout on the connection to the mail server. If the mail server goes down while JIRA is communicating with it, the mail queue can hang.

We have made a build of the atlassian-mail that should fix the problem available here:
http://repository.atlassian.com/atlassian-mail/jars/atlassian-mail-1.2.28.jar

Please download the above file and replace the atlassian-mail jar in
WEB-INF/lib of the JIRA web application with it. For example for JIRA 3.2.2 remove atlassian-mail-1.2.25.jar from WEB-INF/lib directory and place the downloaded atlassian-mail-1.2.28.jar there.

The jar contains a atlassian-mail.properties file with the following properties:

mail.smtp.connectiontimeout=300000
mail.smtp.timeout=600000

(in milliseconds).

This will make the connection timeout after 5 minutes if the mail server is down during the connection or after 10 minutes if the mail server goes down after a connection has been established.

Please restart JIRA for the changes to take effect.

Please let us know if this helps.

Thanks,
Anton


Joshua Spiewak added a comment - 18/Jul/05 10:11 AM
The advice from the article did not do the trick, as the mail queue was backed up this morning again. I have downloaded the atlassian-mail jar file and restarted the server. Hopefully that will do the trick...

Tom Herrmann added a comment - 26/Jul/05 09:26 AM
We had no problems since more then a week with with atlassian-mail-1.2.28.jar.
From our point of view you can close this issue.
Thanks Tom

Joshua Spiewak added a comment - 26/Jul/05 10:24 AM
Same here.

Anton Mazkovoi [Atlassian] added a comment - 26/Jul/05 06:40 PM
Thanks for the update!