Bug 850818

Summary: Globally uncaught exception on clicking OK button while adding CLI Script alert notification to the alert definition
Product: [JBoss] JBoss Operations Network Reporter: Sunil Kondkar <skondkar>
Component: Monitoring - AlertsAssignee: Jirka Kremser <jkremser>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: high    
Version: JON 3.1.1CC: fbrychta, hrupp, jkremser, mithomps, spinder
Target Milestone: ---   
Target Release: JON 3.1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 852415 (view as bug list) Environment:
Last Closed: 2013-09-11 10:59:36 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:    
Bug Blocks: 852415    
Attachments:
Description Flags
Exception
none
Screenshot none

Description Sunil Kondkar 2012-08-22 13:25:51 UTC
Description of problem:

While creating an alert notification to the alert definition, user chooses CLI Script as a notification sender, clicking OK button with default selections displays Globally uncaught exception in UI.

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

Build: Version: 3.1.1.ER3
Build Number: 37108ca:67c6de8
Database: PostgreSQL 8.4.2
Browsers:
Firefox 10.0.2
IE 8.0.7600.16385

How reproducible:

Always

Steps to Reproduce:

1. Login to JBoss ON
2. Navigate to a 'Alerts->Definitions' tab of a resource (Ex: Platform)
3. Click on 'New' button
4. Enter name of the alert and click on the 'Notifications' tab.
5. Click on 'Add' button.
6. Select 'CLI Script' value from the dropdown 'Notification Sender'.
7. Click on 'OK' button (By default the radio button 'Myself' is selected)
8. The UI in background displays 'Globally uncaught exception'.
  
Actual results:

UI displays globally uncaught exception.

Expected results:

No error should be displayed

Additional info:

Additional Info: Exception is not displayed if user selects a repository and existing script or uploads a new scripts and clicks OK button.

Comment 1 Sunil Kondkar 2012-08-22 13:26:49 UTC
Created attachment 606271 [details]
Exception

Comment 2 Sunil Kondkar 2012-08-22 13:27:44 UTC
Created attachment 606272 [details]
Screenshot

Comment 3 Sunil Kondkar 2012-08-27 11:34:02 UTC
Additional Info:
Observed the same error when:

1. Creating alert alert definition with CLI script notification on a compatible group.
2. Creating alert definition template on a resource with CLI script notification.
(Administration->Alert Definition Template->Platform Resource)

Comment 4 Jirka Kremser 2012-08-28 12:37:28 UTC
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=9fda60f

master
time:    Tue Aug 28 14:34:23 2012 +0200
commit:  9fda60f21e354f3b33a1ecf85b81cae19e0af1af
author:  Jirka Kremser - jkremser
message: [BZ 850818 - Globally uncaught exception on clicking OK button while adding CLI Script alert notification to the alert definition] Added the check whether the repository has been picked

Comment 6 Jirka Kremser 2012-11-02 15:16:28 UTC
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=537dfe925

branch:  release/jon3.1.x
time:    Tue Aug 28 14:34:23 2012 +0200
commit:  537dfe925d879d843f3ab36bf87215ecc2735e44
author:  Jirka Kremser - jkremser
message: [BZ 850818 - Globally uncaught exception on clicking OK button while adding CLI Script alert notification to the alert definition] Added the check whether the repository has been picked. (cherry picked from commit 9fda60f21e354f3b33a1ecf85b81cae19e0af1af)

changing status to MODIFIED

Comment 7 Simeon Pinder 2012-11-15 05:01:35 UTC
Moving this to ON_QA as available for testing in https://brewweb.devel.redhat.com//buildinfo?buildID=243389.

Comment 8 Filip Brychta 2012-11-20 10:04:47 UTC
Still occurs for following scenario:
1. Login to JBoss ON
2. Navigate to a 'Alerts->Definitions' tab of a resource (Ex: Platform)
3. Click on 'New' button
4. Enter name of the alert and click on the 'Notifications' tab.
5. Click on 'Add' button.
6. Select 'CLI Script' value from the dropdown 'Notification Sender'.
7. Select the repository where the script should reside from dropdown menu.
8. Upload new script radio button is checked by default. Left 'file' and 'version' fields empty and click on Ok button. 
9. The UI in background displays 'Globally uncaught exception'.

Note: the same behaviour when step 8 is changed this way:
Check existing script radio button and leave relevant dropdown menu empty. Click on Ok button.

So i guess that another check for empty 'existing script' and empty 'upload new script' fields must be added.

Comment 9 Jirka Kremser 2012-11-20 14:29:03 UTC
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=618b064ab

branch:  release/jon3.1.x
time:    Tue Nov 20 15:17:34 2012 +0100
commit:  618b064ab399d0b92dd827158234de4629cba403
author:  Jirka Kremser - jkremser
message: [BZ 850818 - Globally uncaught exception on clicking OK button while adding CLI Script alert notification to the alert definition] Another possible scenario where NPE was thrown was fixed by this commit. (cherry picked from commit 2ae8bc1158dcae4457a738a7414e3c71fd898ed0)

Comment 10 Mike Thompson 2012-11-21 17:01:21 UTC
I had to revert this change as it was not compiling due to a missing dependency on the SortedSelectItem class.

Comment 11 Charles Crouch 2012-11-21 21:30:44 UTC
Here is mike's revert commit http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=release/jon3.1.x&id=11d20d3eb0706fce99dab0d61e3730b329f2b0a1

Jirka, I'm wondering how if this fix got applied to master first, did it not blow up there too?

Comment 12 Jirka Kremser 2012-11-23 10:32:26 UTC
Because in the master, there is commit (1c7723b1f) adding this SortedSelectItem class into our codebase, and it is not in the release branch. The commit was solving bug 675150, and this bug has no target release. Could I set its target to master and create a clone of it for JON 3.1.2 and cherry-pick over the 1c7723b1f. Then I can apply again the 618b064ab3 and it should work. 
Sorry for the inconvenience, I should have run the tests on the release branch, before cherry-picking the changes.

Comment 13 Charles Crouch 2012-11-28 18:13:38 UTC
IMHO https://bugzilla.redhat.com/show_bug.cgi?id=675150 is too big a change for jon312. Can you just use the non-sorted select item in the version in the release branch?

Comment 14 Jirka Kremser 2012-11-30 21:11:06 UTC
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=51ec62419fca40fb15a2b845b2ee0938d1fd30e9

branch:  release/jon3.1.x
time:    Fri Nov 30 22:06:52 2012 +0100
commit:  51ec62419fca40fb15a2b845b2ee0938d1fd30e9
author:  Jirka Kremser - jkremser
message: [BZ 850818 - Globally uncaught exception on clicking OK button while adding CLI Script alert notification to the alert definition] Same changes as in commit 618b064ab399d0b92dd827158234de4629cba403 except of usage of SortedSelectItem


ok, it's done ^. Moving the status to MODIFIED.

Comment 15 Simeon Pinder 2012-12-07 06:31:30 UTC
Moving to ON_QA as available for testing in ER3 or greater: https://brewweb.devel.redhat.com/buildinfo?buildID=246689

Comment 16 Sunil Kondkar 2012-12-07 11:41:58 UTC
Verified on JON 3.1.2 ER3 build.

Verified that there is no exception on:

- By default 'Myself' selected and Not selecting a repository.
- Selecting 'Another User' and 'Username'/ 'Password' fields blank.
- Selecting repository and empty 'existing script' and empty 'upload new script' fields.

Verified above on a single resource, compatible group and alert definition template.