Red Hat Bugzilla – Full Text Bug Listing
|Summary:||Resource with AvailabilityType of NULL is being returned to UI resulting in ResourceDatasource.copyValues throwing org_rhq_core_domain_resource_Resource_currentAvailability is null|
|Product:||[Other] RHQ Project||Reporter:||Larry O'Leary <loleary>|
|Component:||Core Server, Database||Assignee:||Jay Shaughnessy <jshaughn>|
|Status:||CLOSED CURRENTRELEASE||QA Contact:||Mike Foley <mfoley>|
|Version:||4.4||CC:||hrupp, jshaughn, mazz|
|Target Release:||RHQ 4.6|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2013-09-03 10:45:31 EDT||Type:||Bug|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Bug Depends On:|
Description Larry O'Leary 2012-10-10 18:22:49 EDT
Comment 1 Jay Shaughnessy 2012-10-16 14:17:11 EDT
master commit c2b37fd00701018fd5df3f99879c6cf4c2fddc4c Jay Shaughnessy <email@example.com> Tue Oct 16 14:04:41 2012 -0400 I believe this is the cause of the failure. In certain cases a legacy db may not have an rhq_resource_avail record for a resource. It is now eagerly created but in the past it was possible to have resource without the record. The old codepath for initializing resource avail for these resources had an issue. ** NOTE!!! Once the issue occurs, the code fix will will not automatically solve ** the problem. This workaround code below should be applied. The fix will ** only help future upgrades, not upgrades that have already taken place. Workaround SQL that can be applied to databases suffering from this issue: postgres: INSERT INTO RHQ_RESOURCE_AVAIL ( ID, RESOURCE_ID, AVAILABILITY_TYPE ) SELECT nextval('RHQ_RESOURCE_AVAIL_ID_SEQ'::text), res.ID, 2 FROM RHQ_RESOURCE res LEFT JOIN RHQ_RESOURCE_AVAIL avail ON res.ID = avail.RESOURCE_ID WHERE avail.ID IS NULL oracle: INSERT INTO RHQ_RESOURCE_AVAIL ( ID, RESOURCE_ID, AVAILABILITY_TYPE ) SELECT RHQ_RESOURCE_AVAIL_ID_SEQ.nextval, res.ID, 2 FROM RHQ_RESOURCE res LEFT JOIN RHQ_RESOURCE_AVAIL avail ON res.ID = avail.RESOURCE_ID WHERE avail.ID IS NULL Test Notes: Not really easy to test. I'd suggest probably just moving this to VERIFIED if the relevant customer cases are resolved.
Comment 2 Jay Shaughnessy 2012-10-16 14:18:16 EDT
DevNote: If this resolves the issues, the query above could be moved to the db-upgrade.xml script and the codepath could be eliminated completely.
Comment 3 Charles Crouch 2012-11-06 16:08:44 EST
As per 865166 db upgrade needs to be updated with the sql below
Comment 4 John Mazzitelli 2012-11-13 11:03:15 EST
(In reply to comment #3) > As per 865166 db upgrade needs to be updated with the sql below git commit to master 4b888be16b1ae2ceb876e85cc82001bbdc79e516 adds the sql to the db-upgrade script.
Comment 5 Heiko W. Rupp 2013-09-03 10:45:31 EDT
Bulk closing of issues in old RHQ releases that are in production for a while now. Please open a new issue when running into an issue.