Description of problem: When giving a system virtualization platform entitlement, user will in some situations see an error about channel not found. Version-Release number of selected component (if applicable): Satellite-5.3.0-RHEL5-re20090414.0-i386-embedded-oracle.iso How reproducible: Requires very specific setup and unsure how difficult it will be to reproduce. (though the problem is quite clear) Steps to Reproduce: 1. Sync Satellite with RHN Tools and VT channels. 2. Create a second organization with a clone of the RHN Tools and VT channel. 3. Register a system to org 1, edit it's details and assign it the virtualization platform entitlement. Actual results: Error screen: "We're sorry, but the channel could not be found." In catalina.out: 2009-04-16 10:00:33,052 [TP-Processor2] ERROR com.redhat.rhn.common.errors.LookupExceptionHandler - Hibernate LookupException com.redhat.rhn.common.hibernate.LookupException: User 1 does not have access to channel 354 or the channel does not exist at com.redhat.rhn.manager.channel.ChannelManager.lookupByIdAndUser(ChannelManager.java:617) at com.redhat.rhn.manager.channel.ChannelManager.subscribeToChildChannelWithPackageName(ChannelManager.java:1430) at com.redhat.rhn.manager.system.SystemManager.setupSystemForVirtualization(SystemManager.java:1553) at com.redhat.rhn.manager.system.SystemManager.entitleServer(SystemManager.java:1487) at com.redhat.rhn.manager.system.SystemManager.entitleServer(SystemManager.java:1441) at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.checkVirtEntitlements(SystemDetailsEditAction.java:276) at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.processSubmission(SystemDetailsEditAction.java:218) at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.execute(SystemDetailsEditAction.java:113) Expected results: Successfully assign system the RHN Tools channel the user can actually access. Additional info: Problem does appear to be the code locating a channel that's not in the current user's org. The channel in the stack trace is: SQL> select id,org_id,name,label from rhnChannel where id = 354; ID ORG_ID ---------- ---------- NAME ---------------------------------------------------------------- LABEL -------------------------------------------------------------------------------- 354 95 Clone of RHN Tools for RHEL v. 5 for 32-bit x86 Beta clone-rhn-tools-rhel-i386-server-5-beta Whereas my current user was in org 1. Problem is likely *very* close to SystemManager.java setupSystemForVirtualization around this line: Channel toolsChannel = ChannelManager.subscribeToChildChannelWithPackageName( user, server, ChannelManager.TOOLS_CHANNEL_PACKAGE_NAME); Whatever query this boils down to is returning a channel the user cannot access.
Modified the check to search for a channel whose org ID is NULL (Red Hat official), equal to the users org ID, or is "shared" via multi-org. You can verify which channel was selected after by looking for which tools channel the system is subscribed too. Fixed in spacewalk.git: f67ffc88d914a2b2ec4dd3eeb5085e67cc28d1e1 Ported to satellite.git: 2d3317465146a61a3b229314ccac14ddfb3d2b78
Verified ISO: Satellite-5.3.0-RHEL5-re20090520.0-i386-embedded-oracle.iso
*** Bug 514975 has been marked as a duplicate of this bug. ***
Moving to FAILS_QA, tested on 7/24 Stage build... from the bug that I've marked as a duplicate: If a user registers an ia64 system running RHEL 5 Server in an org != 1 and attempts to give this system Virtualization or Virtualization Platform entitlements, they will reach a "We're sorry, but the channel could not be found." error page instead of being granted the appropriate entitlements, despite having access to the requisite RHN Tools and Virtualization channels. When the user returns to the SDC for the system, they will find that the system has been subscribed to its respective Virtualization channel but has not been subscribed to the RHN Tools channel, and the Virtualization/Virtualization Platform entitlement will not be applied. To add a bit of strangeness to this situation, if a user manually subscribes the system to the RHN Tools and Virtualization channels, they can then add the Virtualization/Virtualization Platform without issue.
Has work around as noted above. Post 530.
Upon further testing, Sayli, Brandon, and I discovered three disparate scenarios that produced this issue: Scenario 1: Sayli registered an x86_64 system to an org != 1 and attempted to apply Virtualization/Virtualization Platform entitlements and received the ISE as noted in comment #4 alongside identical behavior (Virtualization child channel subscribed, no Virtualization/Virtualization Platform entitlement added). She then attempted to perform the workaround, and despite being able to subscribe her machine to the RHN Tools channel, she still received the above ISE when reapplying the Virtualization/Virtualization Platform entitlement and no entitlement was added. Thus, several of her machines were resistant to being given Virt entitlements. Scenario 2: Brandon registered an x86_64 system to an org != 1 and attempted to apply Virtualization/Virtualization Platform entitlements, received no ISE, and his system was given the entitlement alongside being subscribed to the Virtualization child channel. However, the system was not subscribed to the RHN Tools child channel. Scenario 3: My scenario, as noted above Given that a situation exists where no workaround works, this seems like a bug that's still applicable to Satellite 530, so I'm bumping it back to sat530-triage for your review.
Justin - Devan is on PTO for two days. Please try and tackle this one for us.
So this problem is easily reproduced if you have an rhn-tools-beta channel synced. It is virtually impossible to do if you do not have it synced. A query was using an incorrect view and making some incorrect assumptions: a98d583
I dont think this bug can be properly tested until https://bugzilla.redhat.com/show_bug.cgi?id=437018 is available and on on_qa failing this bug so they are have the same status
to clarify.. I keep getting ISE's when running through this testplan but they are caused by 437018
I am not sure verification for this bug should be blocked on 437018 as this is a scenario with proper rhn-tools entitlements given to the org which is different from 437018. I was able to sync rhn-tools and rhn-tools beta channels to the satellite. I created an org and gave rhn-tools channel entitlements (NO rhn-tools BETA entitlements). I was able to give virt entitlement to the system successfully. It was registered to rhn-tools and virt channel after giving virt entitlement and installed related packages successfully. Moving to verified.
verfied in stage using scenarios in #4 and #6
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-1434.html