Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1062175 - [events] VDS_ACTIVATE_FAILED set for a subscriber but 'Host $host was activated' is received instead via mail
Summary: [events] VDS_ACTIVATE_FAILED set for a subscriber but 'Host $host was activat...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.4.0
Assignee: Mooli Tayer
QA Contact: bugs@ovirt.org
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-06 12:03 UTC by Jiri Belka
Modified: 2014-02-26 15:03 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-25 18:57:47 UTC
oVirt Team: ---


Attachments (Terms of Use)
engine.log (deleted)
2014-02-06 12:03 UTC, Jiri Belka
no flags Details
notifier.log (deleted)
2014-02-06 13:30 UTC, Jiri Belka
no flags Details

Description Jiri Belka 2014-02-06 12:03:51 UTC
Created attachment 860109 [details]
engine.log

Description of problem:
I tried to get VDS_ACTIVATE_FAILED event. In Admin Portal I assigned 'Failed to activate Host' (Why does 'Host' start with uppercase???) to a user.

Good, mapping is OK: Failed to activate Host -> VDS_ACTIVATE_FAILED

engine=# select * from event_subscriber ;
            subscriber_id             |    event_up_name    | method_id |  method_address   | tag_name 
--------------------------------------+---------------------+-----------+-------------------+----------
 fdfc627c-d875-11e0-90f0-83df133b58cc | VDS_ACTIVATE_FAILED |         0 | jbelka@redhat.com | 
(1 row)

engine=# select * from event_notification_hist where sent_at > '2014-02-06 12:40';
-[ RECORD 1 ]-+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
subscriber_id | fdfc627c-d875-11e0-90f0-83df133b58cc
event_name    | VDS_ACTIVATE
audit_log_id  | 542
method_type   | EMAIL     
sent_at       | 2014-02-06 12:45:16.41+01
status        | t
reason        |

Hoho, now VDS_ACTIVATE_FAILED change to VDS_ACTIVATE.

engine=# select log_type_name,message from audit_log where log_time > '2014-02-06 12:40' and log_type_name ilike '%VDS%';
 log_type_name |                   message                   
---------------+---------------------------------------------
 VDS_ACTIVATE  | Host dell-r210ii-13 was activated by admin.
 VDS_FAILURE   | Host dell-r210ii-13 is non responsive.
(2 rows)

So.... It seems VDS_ACTIVATE_FAILURE is totally ignored and the subscriber is informed about an event he is not interested at all.

Version-Release number of selected component (if applicable):
ovirt-engine-3.4.0-0.5.beta1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. assing 'Failed to activate Host' to a user|mail
2. put a host into maintenance
3. on a host, stop vdsm, remove eXecute bit on vdsmd RC script (chmod a-x /etc/init.d/vdsmd)

Actual results:
nothing about problem to activate host

Expected results:
VDS_ACTIVATE_FAILURE in event_notification_hist table and mail notification

Additional info:

Comment 1 Jiri Belka 2014-02-06 13:30:48 UTC
Created attachment 860166 [details]
notifier.log

Mail notification is also funny...

...
Received: from jb-rh34.rhev.lab.eng.brq.redhat.com ([10.34.63.78])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s16DRgTh005802
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO)
	for <jbelka@redhat.com>; Thu, 6 Feb 2014 08:27:44 -0500
From: ovirt@redhat.com
Date: Thu, 6 Feb 2014 14:27:42 +0100 (CET)
To: jbelka@redhat.com
Message-ID: <978758205.11.1391693262778.JavaMail.ovirt@jb-rh34.rhev.lab.eng.brq.redhat.com>
Subject: Issue Solved Notification. (jb-rh34.rhev.lab.eng.brq.redhat.com),
 [Host dell-r210ii-13 was activated by admin.]
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12

Time:2014-02-06 14:27:42.267
Message:Host dell-r210ii-13 was activated by admin.
Severity:0
User Name: admin
Host Name: dell-r210ii-13
...

'Issue solved...'

Comment 2 Itamar Heim 2014-02-09 08:52:57 UTC
Setting target release to current version for consideration and review. please
do not push non-RFE bugs to an undefined target release to make sure bugs are
reviewed for relevancy, fix, closure, etc.

Comment 3 Eli Mesika 2014-02-17 14:55:05 UTC
Please note the following query :

engine_1053062=> select * from event_map where event_up_name = 'VDS_ACTIVATE_FAILED';
    event_up_name    | event_down_name 
---------------------+-----------------
 VDS_ACTIVATE_FAILED | VDS_ACTIVATE


That means that when VDS_ACTIVATE_FAILED is trapped an email will be sent with the problem and when VDS_ACTIVATE is trapped an email will be sent notifying that the problem has been resolved 

Please recheck that you did not get the 1st email on the problem report since you got the second one that indicates that the host is active again.

So, the email that you got is correct and you should get it when you are subscribing to events that have both up and down fields in events_map.

Comment 4 Jiri Belka 2014-02-17 15:09:07 UTC
Attached notifier.log does not show I should receive anything about failure.

Comment 5 Eli Mesika 2014-02-17 15:15:24 UTC
Moving BZ to Mooli to investigate notifier behavior

Comment 6 Mooli Tayer 2014-02-25 18:57:47 UTC
(In reply to Jiri Belka from comment #4)
> Attached notifier.log does not show I should receive anything about failure.

It is not in the notifier.log.

As Eli stated we have two types of events:
A="Alert Notification." (Something went wrong...)
and B="Issue Solved Notification." (Something is ok again...)
if you subscribe to a type A event that has a type B event associated with it,
(As defined by event_map table ) you automatically receive notifications about both!

If you want to subscribe exclusively to A there is also a way to do that, please see [1] or contact me.

[1] http://www.ovirt.org/Features/configuration-event-subscribers#DB_v.s_Configuration

Closing as not a bug, please contact me if further discussion is needed.

Comment 7 Jiri Belka 2014-02-26 07:50:43 UTC
So why I didn't receive also 'A' (VDS_ACTIVATE_FAILED) notification? Do you see in the logs that 'A' notification was sent? If so, please show me exact line from attached log. Thank you!

Comment 8 Mooli Tayer 2014-02-26 15:03:21 UTC
I see your point.

This bug states two problems:
VDS_ACTIVATE being sent - explained by comment 6

As for VDS_ACTIVATE_FAILED not being sent, The event sent in the given scenario is VDS_FAILURE and not VDS_ACTIVATE_FAILED.

VDS_FAILURE is also available for subscribing in the UI. it is called "Host is non responsive".

While these too events are very confusing. I would say that a user interested in such events should register to both.


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