Bug 488723

Summary: Manually specifying a bad channelId for ChannelPackages results in an ISE
Product: Red Hat Satellite 5 Reporter: John Matthews <jmatthew>
Component: WebUIAssignee: Shannon Hughes <shughes>
Status: CLOSED CURRENTRELEASE QA Contact: John Matthews <jmatthew>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: bperkins, cperry, ssalevan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 20:34:06 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: 456985    

Description John Matthews 2009-03-05 14:03:58 UTC
Description of problem:

ChannelPackagesAction needs to add a check for a bad channel id.

Currently it's doing below:
        long cid = requestContext.getRequiredParam("cid");        
        Channel chan = ChannelFactory.lookupByIdAndUser(cid, user);        
        request.setAttribute("channel_name", chan.getName());


Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090227.1-i386-embedded-oracle.iso

How reproducible:
Always

Steps to Reproduce:
1. Go to /rhn/channels/ChannelPackages.do?cid=121
2. Enter a bad value for cid, i.e. a number which doesn't map to a channel
  
Actual results:
ISE

Expected results:
Some sort of warning/error message about bad channel id

Additional info:

2009-03-05 04:51:39,577 [TP-Processor7] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rhn].[action] - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
	at com.redhat.rhn.frontend.action.channel.ChannelPackagesAction.execute(ChannelPackagesAction.java:54)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:237)
	at com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:82)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:142)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:108)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:55)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
	at java.lang.Thread.run(Thread.java:735)
2009-03-05 04:51:40,091 [RHN Message Dispatcher] ERROR com.redhat.rhn.common.messaging.ActionExecutor - java.lang.NullPointerException

Comment 1 Shannon Hughes 2009-03-05 20:56:04 UTC
going to throw a badparameterexception when the channel objects are null. this will present a page with 200 response but indicate something wrong with parameter. i doubt we will hit this often unless someone is monkeying around with the GET params.

Comment 2 John Matthews 2009-03-11 02:27:28 UTC
Verified
ISO: Satellite-5.3.0-RHEL5-re20090306.2-i386-embedded-oracle.iso


Below is the text which is now displayed.

We're sorry, but the channel could not be found.

This error may have occurred in one of three ways:

   1. The channel requested does not exist. This is most likely if you arrived at this page through bookmarks or some other non-hyperlink.
   2. You do not have permission to view this channel.
   3. You've found an error in our site. Please help us by filling out this form with details of how you received this message.

Comment 3 Steve Salevan 2009-08-25 20:50:28 UTC
RELEASE_PENDING from latest Stage build.

Comment 4 Brandon Perkins 2009-09-10 20:34:06 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/RHEA-2009-1434.html