Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 579022

Summary: ISE when trying to alter server's base channel subscription from None to a base channel
Product: Red Hat Satellite 5 Reporter: Xixi <xdmoon>
Component: ServerAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Garik Khachikyan <gkhachik>
Severity: high Docs Contact:
Priority: high    
Version: 530CC: cperry, gkhachik, mkoci, tao, tlestach, tpapaioa, xdmoon
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-23 07:08:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 518256    
Attachments:
Description Flags
UpdateChildChannelsCommand.java.TEST.716973.1.patch none

Description Xixi 2010-04-02 07:24:09 UTC
Description of problem:
If a system is un-subscribed from base channel then trying to subscribe it to a base channel again fails with an Internal Server Error & following exception in catalina.out:
...
java.lang.NullPointerException
        at com.redhat.rhn.manager.system.UpdateChildChannelsCommand.store(UpdateChildChannelsCommand.java:86)
        at com.redhat.rhn.manager.system.UpdateBaseChannelCommand.store(UpdateBaseChannelCommand.java:94)
        at com.redhat.rhn.frontend.action.systems.sdc.SystemChannelsAction.updateBaseChannel(SystemChannelsAction.java:265)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

Version-Release number of selected component (if applicable):
Red Hat Network (RHN) Satellite 5.3.0

System architecture(s):
RHEL 5 U3 i386 platform

How reproducible:
Always.

Steps to Reproduce:
1. On 5.3 Satellite, set a server's Base channel to none.
2. Try to subscribe it to a Base Channel. 

Actual results:
Internal Server Error & error logs above

Expected results:
Successful subscription, no errors

Additional info:

Comment 1 Xixi 2010-04-02 07:28:58 UTC
Problem appears to be missing null check at 
...
        // Check whether channelsIds are childs of the current base
        if (server.getBaseChannel() != null) {
            Set subscribableChannelIds = SystemManager.subscribableChannelIds(
                            server.getId(), user.getId(), server.getBaseChannel().getId());
...
in spacewalk-java-0.5.44/code/src/com/redhat/rhn/manager/system/UpdateChildChannelsCommand.java

Proposed patch attached.

Comment 2 Xixi 2010-04-02 07:29:49 UTC
Created attachment 404150 [details]
UpdateChildChannelsCommand.java.TEST.716973.1.patch

Comment 7 Justin Sherrill 2010-04-07 16:32:31 UTC
Hi All,

So this has been fixed already by an upcoming errata, so we are going to include this bugzilla in it.  

-Justin

Comment 8 Garik Khachikyan 2010-04-08 08:22:35 UTC
# VERIFIED

The scenario with having prod-synced sat 530 reproduced the issue.

Upgrade of the satellite with the errata packages resolved the ISE when providing the registered client red hat base channel entitlement from (none)...

the scenario was checked against satellites on RHEL4 and RHEL5 platforms.

packages fixing the issue are:
---
python-cheetah-2.0.1-1
cobbler-1.6.6-5
spacewalk-web-0.5.23-34
spacewalk-java-0.5.44-74
spacewalk-backend-0.5.28-40.x.2
---

Comment 10 errata-xmlrpc 2010-04-23 07:08:04 UTC
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/RHBA-2010-0369.html