Bug 1477986

Summary: [UI] - 'Clear All' doesn't working for 'Event's notifications tab
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: Frontend.WebAdminAssignee: Alexander Wels <awels>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: awels, bugs, gshereme
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 10:41:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine log none

Description Michael Burman 2017-08-03 12:09:47 UTC
Description of problem:
[UI] - 'Clear All' doesn't working for 'Event's notifications tab.

The 'Clear All' button is not working when pressing it for the 'Events' notifications tab.
It is working only for the 'Alerts' notifications. 

Version-Release number of selected component (if applicable):
 4.2.0-0.0.master.20170801132145.git3e12cf0.el7.centos

How reproducible:
100%

Steps to Reproduce:
1. Open the notifications Events tab under the bell icon on the top right
2. Press Clear All Alerts
3. Press Clear All Events

Actual results:
2. Works as expected
3. Nothing happens

Expected results:
If we have a 'Clear All' button for events, then it should work as expected. 
If it's not suppose to work for the Events, then 'Clear All' button shouldn't be there.

Comment 1 Michael Burman 2017-08-21 05:14:24 UTC
This shouldn't be ON_QA - tested on 4.2.0-0.0.master.20170820180837.git59243e9.el7.centos

Error while executing action ClearAllAuditLogEvents: Internal Engine Error

From engine.log - 

017-08-21 08:07:37,120+03 ERROR [org.ovirt.engine.core.bll.ClearAllAuditLogEventsCommand] (default task-4) [a8101104-bec6-4361-975f-cd05b050a798] Command 'org.ovirt.engine.core.bll.ClearAllAuditLogEventsCommand' 
failed: CallableStatementCallback; SQL [{call clearallauditlogevents(?)}]; ERROR: deadlock detected
  Detail: Process 11147 waits for ShareLock on transaction 45704817; blocked by process 11152.
Process 11152 waits for ShareLock on transaction 45704801; blocked by process 11147.
  Hint: See server log for query details.
  Where: SQL statement "UPDATE audit_log
    SET deleted = true
    WHERE severity != v_severity"

The events cleared, but with exception in the engine log and in the webadmin UI.
Failed QA

Comment 2 Michael Burman 2017-08-21 05:15:14 UTC
Created attachment 1316087 [details]
engine log

Comment 3 Alexander Wels 2017-08-28 14:20:25 UTC
I think there was an issue with your environment. It appears to be trying to run the clear all events commands, but it is failing on some database issue. I am going to mark it as on QA again (as I tried several times to reproduce and it all works correctly on my system). Can you try it on another environment than the one that gave you this error?

Comment 4 Michael Burman 2017-08-28 14:28:10 UTC
(In reply to Alexander Wels from comment #3)
> I think there was an issue with your environment. It appears to be trying to
> run the clear all events commands, but it is failing on some database issue.
> I am going to mark it as on QA again (as I tried several times to reproduce
> and it all works correctly on my system). Can you try it on another
> environment than the one that gave you this error?

Alexander, 
I have 2 questions:
1) When pressing the 'Clear All' it is taking around 30 seconds+- to clear the events, i think it is quite long. Clear all for Alerts, happen at the moment when pressing with no delay. 

2) Every time pressing the Clear All, i see the next errors in the engine.log:
2017-08-28 17:24:50,291+03 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageBundler] (default task-14) [5412d741-53f4-440b-b3f9-725be90424f1] Key 'USER_CLEAR_ALL_AUDIT_LOG' is not translated in 'bundles/AuditLogMessages'

Is it ok?

Comment 5 Alexander Wels 2017-08-28 14:34:46 UTC
1. Sounds like you have a LOT of events in your database. The clear events and clear alerts basically send the same command, except the alerts filter to just the alerts. I would check you AuditLog table and see if there is an issue with it.

2. Is stating there is no human readable message to indicate that you cleared your log. Its a warning that should get fixed at some point, but won't impact the execution of the command.

Comment 6 Michael Burman 2017-08-29 06:45:58 UTC
(In reply to Alexander Wels from comment #5)
> 1. Sounds like you have a LOT of events in your database. The clear events
> and clear alerts basically send the same command, except the alerts filter
> to just the alerts. I would check you AuditLog table and see if there is an
> issue with it.
> 
> 2. Is stating there is no human readable message to indicate that you
> cleared your log. Its a warning that should get fixed at some point, but
> won't impact the execution of the command.

As we saw, i didn't had a lot of events in my database. Possibly related to the fact i'm running with low memory RAM(4Gb).

Comment 7 Michael Burman 2017-08-29 07:07:44 UTC
Verified on - 4.2.0-0.0.master.20170828065003.git0619c76.el7.centos

Comment 8 Sandro Bonazzola 2017-12-20 10:41:38 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.