Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 589862 - NullPointerException when user selects Base Channel tab from SSM->Manage Channel Memberships
Summary: NullPointerException when user selects Base Channel tab from SSM->Manage Chan...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI
Version: 530
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Partha Aji
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On:
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2010-05-07 06:53 UTC by Xixi
Modified: 2018-11-14 19:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-28 15:04:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Xixi 2010-05-07 06:53:06 UTC
Description of problem:
When a admin selects the Base Channel tab from the Channels tab in the SSM an internal server error results. tomcat throws this error in catalina.out:
2010-04-28 14:53:28,723 [TP-Processor9] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
javax.servlet.ServletException
...
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
...
Caused by:
java.lang.NullPointerException
       at com.redhat.rhn.manager.channel.ChannelManager.listCompatibleBaseChannelsForChannel(ChannelManager.java:2108)
       at com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.setupList(BaseSubscribeAction.java:364)
       at com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.unspecified(BaseSubscribeAction.java:105)
       at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:249)
       at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
       at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:150)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
       ... 40 more
2010-04-28 14:53:28,731 [TP-Processor9] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rhn].[action] - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
       at com.redhat.rhn.manager.channel.ChannelManager.listCompatibleBaseChannelsForChannel(ChannelManager.java:2108)
       at com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.setupList(BaseSubscribeAction.java:364)
       at com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.unspecified(BaseSubscribeAction.java:105)
       at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:249)
       at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
       at ...

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

How reproducible:
For customer, consistently with an admin that only has privs to certain custom base channels and groups

Steps to Reproduce (from customer):
1. For a normal user, with no roles we get the error when clicking on the Base Channels tab under the Channels tab. When I give that user either the Channel Administrator or the Organization Administrator role the ISE does not occur. This admin has been selected as a Manager and a Subscriber to a number of Custom base channels (cloned from Red Hat Base channels) of different OS levels and archs.
2. This error was generated with just one system in the SSM. The one system in the SSM is an AS4, i386 system. The channel it is subscribed to and the channel he would be moving to are both cloned base channels, cloned from Red Hat base channels. He is a manager and subscriber to both these channels. The system is in the group that has access to (obviously).

Actual results:
Internal Server Error

Expected results:
Display the base channel choices available to this administrator based on their permissions.

Additional info:
I've not been able to reproduce internally but based on the line numbers did find a missing null check in spacewalk-java-0.5.44/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
...
           Channel c = ChannelFactory.lookupByIdAndUser(ecd.getId().longValue(), u);
           log.debug("   " + c.getName());
...
the log.debug line doesn't have a null check for the Channel c, not to mention also missing a if-debug-enabled check. Partha has already checked in a patch to spacewalk - http://git.fedorahosted.org/git/?p=spacewalk.git;a=commit;h=4a12466c39a4f963d3f554876c46f4ea7edce08a

Comment 1 Xixi 2010-05-11 17:32:00 UTC
Finally replicated in-house with following steps and confirms the patch fixes this bug (thanks Partha!)

How to reproduce:
1) Create a new custom base channel, set "Per-User Subscription Restrictions:" to "Only selected users within your organization may subscribe to this channel."
2) Create a new user with no roles
3) Assign the user to a system group with at least 1 system....
4) Login as the user
5) Select the system, adding it to SSM
6) click SSM -> Manage Channel memberships -> Base Channel

Comment 3 Partha Aji 2010-08-06 15:52:26 UTC
should be resolved...

Comment 7 Garik Khachikyan 2010-09-03 09:10:35 UTC
# VERIFIED

The scenario of verification is:
1. make a user with no roles (normal_user)
2. prepare a custom channel with an option "Only selected users within your organization may subscribe to this channel." --The point in here is in *NOT* assigning that user to the custom channel.
3. Make a system group, apply there a system and subscribe that user to the group created.
4. login by that user.
5. select system and refer to the SSM -> Manage systems' channel memberships
6. Refer to the "Base channels" tab

on the spacewalk-java-0.5.44-88.el5sat in this step there was thrown ISE
on the spacewalk-java-1.2.17-1.el5sat - no ISE, there are listed base channels correctly.

Comment 13 Clifford Perry 2010-10-28 14:58:40 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


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