Globally uncaught Exception shown in the JBoss ON UI when trying to display orphaned operation schedule

Solution Unverified - Updated

Environment

  • Red Hat JBoss Operations Network (JON) 3.2
  • An operation is created for resource (i.e. platform) by the user (i.e. testUser); This operation is configured to be repeatedly executed;
  • User testUser is deleted from JBoss ON UI -> Administration -> Users page by superuser rhqadmin;
  • The superuser rhqadmin navigate to the operation schedule page for resource platform;

Issue

  • Globally uncaught Exception shown in the JBoss ON UI when trying to display orphaned operation schedule
  • When attempting to remove a resource group (dynagroup of agent launcher scripts), we fail with this in the server log:
10:08:24,994 ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:7443-2) JBAS014134: EJB Invocation failed on component OperationManagerBean for method public abstract java.util.List org.rhq.enterprise.server.operation.OperationManagerRemote.findScheduledGroupOperations(org.rhq.core.domain.auth.Subject,int) throws java.lang.Exception: javax.ejb.EJBTransactionRolledbackException: Cannot schedule an operation without a user associated with it
...
...
Caused by: java.lang.NullPointerException: Cannot schedule an operation without a user associated with it
...

Resolution

This is a bug and two Bugzillas have been created to address this issue:

In the meantime, to remove orphaned operation schedule, the following can be done:

  1. Backup existing JBoss ON Database;
  2. In the following SQL commands replace <deleted_user> with the name of the deleted user (for instance testUser) and execute commands using any database tool 1:
2a.  DELETE FROM rhq_operation_schedule WHERE job_name IN (SELECT job_name FROM rhq_operation_history WHERE subject_name = '<deleted_user>');

2b.  DELETE FROM rhq_qrtz_triggers WHERE job_name IN (SELECT job_name FROM rhq_operation_history WHERE subject_name = '<deleted_user>');

2c.  DELETE FROM rhq_qrtz_simple_triggers WHERE trigger_name IN (SELECT trigger_name FROM rhq_qrtz_triggers WHERE job_name IN (SELECT job_name FROM rhq_operation_history WHERE subject_name = '<deleted_user>'));

2d.  DELETE FROM rhq_qrtz_job_details WHERE job_name IN (SELECT job_name FROM rhq_operation_history WHERE subject_name = '<deleted_user>');

2e.  COMMIT;
1

Note: Do not use JBoss ON UI to execute above SQLs (i.e. http://jon.server.example.com:7080/coregui/#Test/ServerAccess/SQL) as auto-commit does not work. This SQL utility is JBoss ON internal utility and as such it is not recommended to be used by customers.

SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.