Unable to remove JBoss ON resource group that was used as a destination for multiple provisioning bundles
Environment
- Red Hat JBoss Operations Network (ON) 3.3
- More then one bundle version was deployed on the destination defined with the resource group that should be deleted;
Issue
-
Not able to remove an empty group of platforms
-
Failed to delete selected resource groups.:WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:7080-10) SQL Error: 2292, SQLState: 23000 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:7080-10) ORA-02292: integrity constraint (RHQADMIN.SYS_C0016515) violated - child record found ERROR [org.hibernate.engine.jdbc.batch.internal.BatchingBatch] (http-/0.0.0.0:7080-10) HHH000315: Exception executing batch [could not execute batch] WARN [com.arjuna.ats.arjuna] (http-/0.0.0.0:7080-10) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffa87c2d5b:6004142:54f86e18:99d08, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@4f3baa50 >: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch -
Delete of platform resource group fails:
WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:7080-2) SQL Error: 0, SQLState: 23503 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:7080-2) ERROR: update or delete on table "rhq_bundle_deployment" violates foreign key constraint "rhq_bundle_deployment_replaced_bundle_deployment_id_fkey" on table "rhq_bundle_deployment" Detail: Key (id)=(10041) is still referenced from table "rhq_bundle_deployment". ERROR [org.hibernate.engine.jdbc.batch.internal.BatchingBatch] (http-/0.0.0.0:7080-2) HHH000315: Exception executing batch [could not execute batch] -
Resource group cannot be deleted if more then one bundle version is deployed
Resolution
This issue has been address in JBoss ON 3.3 Update-05.
If unable to upgrade, to work around this issue, delete the bundle destinations from the UI and then delete the resource group.
Root Cause
Currently, resource group will be properly deleted if only one bundle version is deployed to the destination. However, if more then one bundle version is deployed, resource group will not be deleted because rhq_bundle_deployment table will still contain the bundle version history linking.
This issue has been captured in This content is not included.Red Hat Bugzilla 1206084.
Diagnostic Steps
This can be reproduced in the following way:
- Create a recursive compatible resource group that contains two or more EAP instances;
- Navigate to Bundle in JBoss ON UI and upload few versions of the bundle;
- Deploy bundle versions to the destination that is using resource group created in the step 1;
- From JBoss ON UI -> Inventory -> Compatible Groups -> select group from step 1 and press "Delete" button;
This will cause the resource group to be empty. JBoss ON UI will show an error pop up message 'Failed to delete selected resource groups' and exceptions as in description will be thrown in the server.log file. Also, bundle destinations that were referenced with this group will still be shown in the JBoss ON UI.
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.