Bug 1173164

Summary: Globally uncaught Exception shown in the JBoss ON UI when trying to display orphaned operation schedule
Product: [JBoss] JBoss Operations Network Reporter: bkramer <bkramer>
Component: Core ServerAssignee: Libor Zoubek <lzoubek>
Status: CLOSED ERRATA QA Contact: Filip Brychta <fbrychta>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.2.3CC: fbrychta, loleary, lzoubek, myarboro, spinder, theute
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-30 16:41:24 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: 1173166    
Bug Blocks:    

Description bkramer 2014-12-11 15:03:43 UTC
Description of problem:
When user is being deleted, his scheduled operation will not be displayed in the JBoss ON UI and Globally Uncaught Exception will be thrown. The error message in the Message Center is:

**************************************************
java.lang.RuntimeException:Failed to find scheduled operations for Resource[id=10001, uuid=9ccd9a34-1c25-4d1a-b65e-7de93b76fdfa, type={Platforms}Linux, key=example.server.com, name=example.server.com, parent=<null>, version=Linux 2.6.35.14-106.fc14.x86_64].s
   java.lang.RuntimeException:[1418305893660] javax.ejb.EJBException:java.lang.NullPointerException: Cannot schedule an operation without a user associated with it -> java.lang.NullPointerException:Cannot schedule an operation without a user associated with it
--- STACK TRACE FOLLOWS ---
Failed to find scheduled operations for Resource[id=10001, uuid=9ccd9a34-1c25-4d1a-b65e-7de93b76fdfa, type={Platforms}Linux, key=example.server.com, name=example.server.com, parent=<null>, version=Linux 2.6.35.14-106.fc14.x86_64].
   at Unknown.Throwable_2(Unknown Source)
   at Unknown.RuntimeException_2(Unknown Source)
   at Unknown.$onFailure_68(Unknown Source)
   at Unknown.onFailure_459(Unknown Source)
   at Unknown.$onResponseReceived(Unknown Source)
   at Unknown.onResponseReceived_4(Unknown Source)
   at Unknown.$fireOnResponseReceived(Unknown Source)
   at Unknown.onReadyStateChange_0(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.apply(Unknown Source)
   at Unknown.entry0(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.anonymous(Unknown Source)
Caused by: java.lang.RuntimeException: [1418305893660] javax.ejb.EJBException:java.lang.NullPointerException: Cannot schedule an operation without a user associated with it -> java.lang.NullPointerException:Cannot schedule an operation without a user associated with it
   at Unknown.RuntimeException_0(Unknown Source)
   at Unknown.instantiate_32(Unknown Source)
   at Unknown.$instantiate_0(Unknown Source)
   at Unknown.$instantiate(Unknown Source)
   at Unknown.$readObject(Unknown Source)
   at Unknown.$onResponseReceived(Unknown Source)
   at Unknown.onResponseReceived_4(Unknown Source)
   at Unknown.$fireOnResponseReceived(Unknown Source)
   at Unknown.onReadyStateChange_0(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.apply(Unknown Source)
   at Unknown.entry0(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.anonymous(Unknown Source)
***************************************************

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

How reproducible:
Always

Steps to Reproduce:
1. Create a user "test" with sufficient permissions
2. As "test" user, log in to JBoss ON UI, navigate to the resource and schedule operation to be executed every 2 minutes indefinitely. 
3. Log out and log in again as "rhqadmin" user;
4. Delete "test" user from the system;
5. Navigate to the Operation schedule for the resource defined in the step 2


Actual results:

Operation schedule will not be shown and Globally Uncaught Exception is thrown.


Expected results:
Operation schedule is shown and no exception is thrown.

Additional info:

Comment 1 Libor Zoubek 2015-06-04 22:36:15 UTC
Pull request sent

https://github.com/rhq-project/rhq/pull/175

Fixed by removing operation schedules (and unscheduling it) when the user
does not exist anymore. This removal does not happen at the time when user
is deleted, it happens when either - user want's to see such schedule (which
refers to missing user) or when scheduled job is about to run (in this case
it is canceled).

I was not able to good find a way how to lookup all scheduled operations by the user being deleted at the time he's deleted - if it was possible we could be able to unschedule the jobs when the user is being deleted. But I don't think it's an issue. Also rescheduling the jobs under different user (probably admin who's deleting the user) might not be good idea. So I think deleting & unscheduling the schedules is the best think to do.

We may need to update documentation, so users are aware of this consequence, on the other hand, it is not a change, because without this bugfix those operations could not be executed anyway.

QE Note: same reprosteps written in description apply to group operations (please verify)

Comment 4 Simeon Pinder 2015-07-10 18:55:25 UTC
Available for test with 3.3.3 ER01 build: 
https://brewweb.devel.redhat.com/buildinfo?buildID=446732
 *Note: jon-server-patch-3.3.0.GA.zip maps to ER01 build of
 jon-server-3.3.0.GA-update-03.zip.

Comment 5 Filip Brychta 2015-07-13 15:13:03 UTC
Verified on
Version :	
3.3.0.GA Update 03
Build Number :	
e4b348a:2f80c8c

Added bz1242563 to capture documentation work

Comment 7 errata-xmlrpc 2015-07-30 16:41:24 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/RHSA-2015-1525.html