Description of problem: I added a user to the system ( the user defined with redhat email address in AD ) and subscribed him to an event( oVirt engine has stopped ) . After that I stopped ovirt-engine service on my RHEVM and wait for few minutes . The mail wasn't sent and I saw exception in the notification log ( Failed to dispatch message java.lang.NullPointerException ) . Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: 2012-11-27 13:56:11,835 ERROR [org.ovirt.engine.core.notifier.NotificationService] Failed to dispatch message java.lang.NullPointerException at org.ovirt.engine.core.notifier.utils.sender.mail.JavaMailSender.send(JavaMailSender.java:178) at org.ovirt.engine.core.notifier.utils.sender.mail.EventSenderMailImpl.send(EventSenderMailImpl.java:81) at org.ovirt.engine.core.notifier.NotificationService.processEvents(NotificationService.java:205) at org.ovirt.engine.core.notifier.NotificationService.run(NotificationService.java:95) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) 2012-11-27 14:01:14,962 ERROR [org.ovirt.engine.core.notifier.NotificationService] Failed to dispatch message java.lang.NullPointerException at org.ovirt.engine.core.notifier.utils.sender.mail.JavaMailSender.send(JavaMailSender.java:178) "notifier.log" 75L, 8574C
Created attachment 652645 [details] notifier log
When the MAIL_FROM properties isn't set on [1], the notification service tries to populate it with the same value as provided by MAIL_USER. Neither MAIL_USER nor MAIL_FROM are mandatory for sending the email. However, if the message dispatch operations fails, an information is logged about the error the message details including the sender (MAIL_FROM). Since this field wasn't set - the NPE is thrown. The following is taken from [2], line 178 log.error(String.format("Failed to send message from [%s] to [%s] with subject [%s] due to error: [%s]", from.toString()...) from.toString() causes the NPE. [1] /etc/ovirt-engine/notifier/notifier.conf [2] ovirt-engine/backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
Suggested patch upstream - http://gerrit.ovirt.org/#/c/9726/2
Verified on si27: Put MAIL_USER & MAIL_FROM in comment. Notification email sent, and no dispatch message or exception error seen in the notifier.log
3.2 has been released