Bug 921405 - engine-notifierd service start fail, but look as pass, for "MAIL_SERVER=" in notifier.conf.
Summary: engine-notifierd service start fail, but look as pass, for "MAIL_SERVER=" in ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-notification-service
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.2.0
Assignee: Yair Zaslavsky
QA Contact: Ilanit Stein
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-14 06:58 UTC by Ilanit Stein
Modified: 2016-02-10 19:02 UTC (History)
9 users (show)

Fixed In Version: sf14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 14130 0 None None None Never

Description Ilanit Stein 2013-03-14 06:58:36 UTC
Description of problem:

On a clean installed sf-10, where in /etc/ovirt-engine/notifier/notifier.conf, MAIL_SERVER parameter looks like this:

MAIL_SERVER=
The notifier service is not started, though it looks like it did:

root@istein-32 notifier]# /etc/rc.d/init.d/engine-notifierd start
Starting engine-notifier: at Wed Mar 13 13:27:14 IST 2013  [  OK  ]
[root@istein-32 notifier]# /etc/rc.d/init.d/engine-notifierd status
Notifier service is not running for pid 15182

notifier.log:
============

2013-03-13 12:11:29,839 INFO  [org.ovirt.engine.core.notifier.utils.NotificationConfigurator] Starting event notification service with configuration file: /etc/ovirt-engine/notifier/notifier.conf
2013-03-13 12:11:29,844 ERROR [org.ovirt.engine.core.notifier.Notifier] Failed to run the event notification service.
java.lang.IllegalArgumentException: Check configuration file, /etc/ovirt-engine/notifier/notifier.conf MAIL_SERVER is missing
        at org.ovirt.engine.core.notifier.Notifier.main(Notifier.java:55)
2013-03-13 13:27:14,676 INFO  [org.ovirt.engine.core.notifier.utils.NotificationConfigurator] Starting event notification service with configuration file: /etc/ovirt-engine/notifier/notifier.conf
2013-03-13 13:27:14,681 ERROR [org.ovirt.engine.core.notifier.Notifier] Failed to run the event notification service.
java.lang.IllegalArgumentException: Check configuration file, /etc/ovirt-engine/notifier/notifier.conf MAIL_SERVER is missing
        at org.ovirt.engine.core.notifier.Notifier.main(Notifier.java:55)

/etc/ovirt-engine/notifier/notifier.conf (This file was untouched after rhevm clean install):
==============================================================================

#
# This file holds the configuration of oVirt events notification daemon.
# The daemon consists of two major services: notification service and engine monitoring.
#

#-------------------------------------#
# Notification Service Configuration: #
#-------------------------------------#
# Interval (in seconds) between iterations of dispatching messages to subscribers. Default is 120 seconds.
#INTERVAL_IN_SECONDS=120

# The SMTP mail server address. Required.
MAIL_SERVER=

# The default port of non-secured SMTP server is 25, for secured (ssl enabled) 465.
#MAIL_PORT=25

# Required if SSL enabled to authenticate the user. Used also to specify 'from' user address if mail server
# supports, when MAIL_FROM is not set. Address is in RFC822 format
#MAIL_USER=

# Required to authenticate the user if mail server requires authentication or if SSL is enabled
#MAIL_PASSWORD=

# Indicates whether SSL should be used to communicate with mail server. Default is false.
#MAIL_ENABLE_SSL=true

# If set to true, sends a message in HTML format. Default is false.
#HTML_MESSAGE_FORMAT=true

# Specifies 'from' address on sent mail in RFC822 format, if supported by mail server.
#MAIL_FROM=

# Specifies 'reply-to' address on sent mail in RFC822 format.
#MAIL_REPLY_TO=

# Amount of days to keep dispatched events on history table. If not set, events remain on history table.
#DAYS_TO_KEEP_HISTORY=30

# This parameter specifies how many days of old events are processed and sent
# when the notifier starts. If set to 2, for example, the notifier will
# process and send the events of the last two days, older events will just
# be marked as processed and won't be sent. The default is 0, so no old
# messages will be sent at all during startup.
#DAYS_TO_SEND_ON_STARTUP=0

#----------------------------------#
# Engine Monitoring Configuration: #
#----------------------------------#
# Interval (in seconds) between engine server monitoring iterations. Interval is being measured from
# the time an iteration is completed. Default is 300 seconds.
#ENGINE_INTERVAL_IN_SECONDS=300

# Number of retries to monitor server status per iteration. Default is 3 retries.
#ENGINE_MONITOR_RETRIES=3

# Time (in seconds) to wait between retries. Default is 30 seconds.
#ENGINE_TIMEOUT_IN_SECONDS=30

# If running Jboss in secure mode, should be set to true. Default is false.
#IS_HTTPS_PROTOCOL=true

# Specifies the protocol used by Jboss Configuration Connector when SSL is enabled. Default is 'TLS'.
#SSL_PROTOCOL=TLS

# If running Jboss in secure mode, and wishes to ignore SSL errors, should set to true. Default is false.
#SSL_IGNORE_CERTIFICATE_ERRORS=false

# If running Jboss in secure mode, and wishes to ignore hostname verification, should set to true. Default is false.
# If setting this property to 'true', SSL_IGNORE_CERTIFICATE_ERRORS considered to be set to 'true' as well: disabling host name
# verification means that it will not be verified against the certification, therefore certification errors are ignored.
#SSL_IGNORE_HOST_VERIFICATION=false

# Specifies whether to repeat auditing of failure messages of non-responding engine server. Default is false (meaning
# repeated failure messages will NOT be sent to the subscribers)
#REPEAT_NON_RESPONSIVE_NOTIFICATION=false

Comment 1 Oded Ramraz 2013-03-14 07:56:32 UTC
Setting severity to high due to false positive : Service reported as started wrongfully .

Comment 2 Yair Zaslavsky 2013-04-07 16:17:17 UTC
There are two problematic areas in the notifier code -
1. The notifier code always returns the same error code to the notifier running script. No indication if the code failed or not (the script should check the return code)
2. Validation is done at the running script, and check only for the existence of MAIL_SERVER, and not for its actual content -> the notifier code is executed, fails with no proper error code handling, and this is why starting the service passes.

Comment 4 Yair Zaslavsky 2013-04-08 14:45:22 UTC
Why is it set as regression?
Did this specific test ever worked? (i.e - checking what happens when MAIL_SERVER exists at the conf, but set to empy value).

Comment 7 Ilanit Stein 2013-04-22 11:17:21 UTC
Tested on SF13.1.
engine-notifierd start is stuck.
Ctrl+c  disconnect cli console.

[root@istein-32 ovirt-engine]# /etc/rc.d/init.d/engine-notifierd status
/etc/rc.d/init.d/engine-notifierd is stopped
[root@istein-32 ovirt-engine]# /etc/rc.d/init.d/engine-notifierd start
Starting engine-notifier: at Mon Apr 22 14:13:12 IDT 2013

Comment 8 Yair Zaslavsky 2013-04-22 11:22:29 UTC
Please provide the configuration you used.
What do you mean by stuck? you did not see anything after performing 

/etc/rc.d/init.d/engine-notifierd start?

Comment 9 Yair Zaslavsky 2013-04-22 13:08:35 UTC
nslookup check is problematic, it may pass, and still email sending will fail.
We will check only if MAIL_SERVER is not empty, for example configurations that do not contain a line with MAIL_SERVER or that contain MAIL_SERVER= will not pass.

Comment 11 Ilanit Stein 2013-05-21 06:41:29 UTC
Verified on sf-17:

In /etc/ovirt-engine/notifier/notifier.conf, 
MAIL_SERVER parameter looks like this:

MAIL_SERVER=

[root@istein-32 cyan-vdse-2013052108231369113832]# /etc/rc.d/init.d/engine-notifierd start
Starting engine-notifier: at Mon May 20 21:38:44 IDT 2013Error: $MAIL_SERVER is not defined, please check for this in configuration file /etc/ovirt-engine/notifier/notifier.conf
                                                           [FAILED]

Comment 12 Itamar Heim 2013-06-11 09:20:31 UTC
3.2 has been released

Comment 13 Itamar Heim 2013-06-11 09:43:30 UTC
3.2 has been released


Note You need to log in before you can comment on or make changes to this bug.