Bug 496080 - Channel Not Found Error Giving System Virtualization Platform Entitlement
Channel Not Found Error Giving System Virtualization Platform Entitlement
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Virtualization (Show other bugs)
530
All Linux
urgent Severity high
: ---
: ---
Assigned To: Justin Sherrill
Sayli Karmarkar
:
: 514975 (view as bug list)
Depends On:
Blocks: 456985
  Show dependency treegraph
 
Reported: 2009-04-16 10:21 EDT by Devan Goodwin
Modified: 2009-09-10 16:35 EDT (History)
6 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 16:35:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Devan Goodwin 2009-04-16 10:21:42 EDT
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.
Comment 1 Devan Goodwin 2009-04-23 15:55:22 EDT
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
Comment 2 John Matthews 2009-05-26 15:47:06 EDT
Verified ISO: Satellite-5.3.0-RHEL5-re20090520.0-i386-embedded-oracle.iso
Comment 3 Steve Salevan 2009-07-31 14:35:07 EDT
*** Bug 514975 has been marked as a duplicate of this bug. ***
Comment 4 Steve Salevan 2009-07-31 14:36:57 EDT
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.
Comment 5 Clifford Perry 2009-07-31 14:39:40 EDT
Has work around as noted above. 

Post 530.
Comment 6 Steve Salevan 2009-07-31 18:08:55 EDT
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.
Comment 7 Clifford Perry 2009-08-03 08:45:06 EDT
Justin - Devan is on PTO for two days. Please try and tackle this one for us.
Comment 8 Justin Sherrill 2009-08-03 12:32:13 EDT
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
Comment 9 wes hayutin 2009-08-10 14:14:26 EDT
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
Comment 10 wes hayutin 2009-08-10 14:15:07 EDT
to clarify.. I keep getting ISE's when running through this testplan but they are caused by 437018
Comment 11 Sayli Karmarkar 2009-08-10 14:43:23 EDT
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.
Comment 12 Miroslav Suchý 2009-08-13 06:26:08 EDT
verfied in stage using scenarios in #4 and #6
Comment 13 Brandon Perkins 2009-09-10 16:35:46 EDT
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

Note You need to log in before you can comment on or make changes to this bug.