Bug 1382649

Summary: Attempt to add notification for the second alert definition in UI throws message "Failed to get notification configuration preview"
Product: [JBoss] JBoss Operations Network Reporter: bkramer <bkramer>
Component: Core ServerAssignee: Ruben Vargas Palma <rvargasp>
Status: CLOSED ERRATA QA Contact: Prachi <pyadav>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.7CC: fbrychta, jmartine, loleary, pyadav, rvargasp, spinder
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 18:45:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1091965    
Bug Blocks:    
Attachments:
Description Flags
UI screen-shot attached
none
No-error screen-shot none

Description bkramer 2016-10-07 10:03:29 UTC
Description of problem:
Attempt to add notification for the second alert definition in JBoss ON UI throws message "Failed to get notification configuration preview".


Version-Release number of selected component (if applicable):
JBoss ON 3.3.7

How reproducible:
Always

Steps to Reproduce:
1. Navigate to JBoss ON UI -> Inventory -> Servers -> RHQ Agent -> Alert -> Definition;
2. Click on "New" button;
3. In "General Properties", Enter Alert name;
4. Navigate to Conditions, Add a condition like, "Condition Type: Measurement Absolute Value Threshold, Metric: Agent server Clock Different", Fill some values for other boxes;
5. Navigate to "Notifications", Click Add, "Notification Sender: System User", select assigned user as "rhqadmin", Click OK;
6. Click on "Save";
7. Click on "Back to List";
8. Repeat from Step #2 again


Actual results:
Attempt to configure notification for the second alert definition logs message "Failed to get notification configuration preview" and "Configuration" column in the Notification tab shows "unknown". If "Save" button is pressed, above message is deleted and "Configuration" column will be set to "rhqadmin".


Expected results:
No error message is thrown;

Additional info:

At the time when "Failed to get notification configuration preview" message is shown, server.log file logs the following:

***********************************************************************
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/coregui]] (http-10.33.24.113:7080-1) org.rhq.coregui.CoreGUI AlertDefinitionGWTService: An IncompatibleRemoteServiceException was thrown while processing this call.: com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Attempt to deserialize an object of type class org.rhq.core.domain.alert.AlertCondition when an object of type class org.rhq.core.domain.alert.AlertDefinition is expected
        ...
	at org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:125) [rhq-rtfilter-4.12.0.JON330GA-redhat-1.jar:4.12.0.JON330GA-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]
	at org.rhq.coregui.server.filter.CacheControlFilter.doFilter(CacheControlFilter.java:71) [classes:]
        ...
Caused by: com.google.gwt.user.client.rpc.SerializedTypeViolationException: Attempt to deserialize an object of type class org.rhq.core.domain.alert.AlertCondition when an object of type class org.rhq.core.domain.alert.AlertDefinition is expected
	at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:636) [gwt-servlet-2.5.0.jar:]
	at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567) [gwt-servlet-2.5.0.jar:]
	at com.google.gwt.user.server.rpc.core.java.util.Collection_ServerCustomFieldSerializerBase.deserialize(Collection_ServerCustomFieldSerializerBase.java:38) [gwt-servlet-2.5.0.jar:]
        ...
***********************************************************************

Comment 1 Josejulio Martínez 2016-12-29 19:54:46 UTC
commit fef5e1d83c6b101016eb95077e15c52693b6f003
Merge: eed7a63 758ad86
Author: Josejulio Martínez <finwemartinez>
Date:   Thu Dec 29 13:34:54 2016 -0600

    Merge pull request #281 from rubenvp8510/alerts_exception
    
    Bug 1382649 -Attempt to add notification for the second alert..

commit 758ad86cc90721921b34e4cfc779c9768965d3ca
Author: Ruben Vargas <ruben.vp8510>
Date:   Thu Dec 15 08:44:44 2016 -0600

    Removed recursive AlertDefinition, fixes Bug 1382649

Comment 4 Prachi 2017-01-25 12:57:50 UTC
This bug is verified in JON 3.3.8 ER01.

Successfully created second error without any error. Please find attached screen-shot.

Comment 5 Prachi 2017-01-25 12:58:42 UTC
Created attachment 1244259 [details]
UI screen-shot attached

Comment 6 Prachi 2017-01-25 13:39:04 UTC
Created attachment 1244266 [details]
No-error screen-shot

Comment 7 errata-xmlrpc 2017-02-16 18:45:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://rhn.redhat.com/errata/RHEA-2017-0285.html