+++ This bug was initially created as a clone of Bug #731586 +++ Description of problem: If any virtual guests of a virtualization host or virtualization platform-entitled host are subscribed to a channel from a trusted organization, then any attempt to remove add-on system entitlements (e.g., Provisioning) from the host's system profile will result in an Internal Server Error. Version-Release number of selected component (if applicable): satellite-schema-5.4.0.13-1.el5sat spacewalk-schema-1.2.21-13.el5sat How reproducible: 100% Steps to Reproduce: 1. Subscribe RHEL virtual host to Satellite, add Virtualization Host entitlement, and register one of its guests as well. 2. Create a custom child channel in another org, share it with the original org, and subscribe the virtual guest to the channel. 3. Add Provisioning entitlement to the virtual host. 4. Now try to remove the Provisioning entitlement. Actual results: Internal Server Error. Tomcat log shows Oracle error: *** ERROR at line 1: ORA-20288: (invalid_server_group_member) - The specified entitlement can not be removed from the specified server because the server does not have that entitlement level ORA-06512: at "RHNSAT.RHN_EXCEPTION", line 23 ORA-06512: at "RHNSAT.RHN_ENTITLEMENTS", line 334 ORA-06512: at line 1 *** Expected results: Add-on entitlement is removed without error. Additional info: The error occurs in the rhn_entitlements.repoll_virt_guest_entitlements procedure, when it attempts to look up the max_members value for each channel family that is in use by one of the virtual guests: *** -- get the max members of the family select max_members into max_members_val from rhnPrivateChannelFamily where channel_family_id = family.channel_family_id and org_id = org_id_val; *** This SELECT statement returns no results, because there is no entry stored in rhnPrivateChannelFamily for org X systems subscribed to an org Y channel family. --- Additional comment from jpazdziora on 2012-01-09 08:30:16 EST --- Would the following patch to the rhn_entitlements package body help on your ... box? ... diff --git a/schema/spacewalk/oracle/packages/rhn_entitlements.pkb b/schema/spacewalk/oracle/packages/rhn_entitlements.pkb index 9704ade..3cd6d59 100644 --- a/schema/spacewalk/oracle/packages/rhn_entitlements.pkb +++ b/schema/spacewalk/oracle/packages/rhn_entitlements.pkb @@ -648,6 +648,8 @@ is rhn_channel.channel_family_current_members(family.channel_family_id, org_id_val); -- fixed transposed args + begin + -- get the max members of the family select max_members into max_members_val @@ -698,6 +700,9 @@ is rhn_channel.update_family_counts(family.channel_family_id, org_id_val); + exception when no_data_found then null; + end; + -- It is possible that the guests belong to a different org than the host -- so we are going to update the family counts in the guests orgs also for org in virt_guest_orgs loop
Modified in Spacewalk master, 238d73f87561ca00ff2815f0a5f230eb7be9190b.
Spacewalk 1.7 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes17
Created attachment 1091908 [details] tea