Bug 671450 - ISE when satadmin attempts to adjust Software Channel Entitlements for an organization
Summary: ISE when satadmin attempts to adjust Software Channel Entitlements for an org...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 540
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Martin Minar
URL:
Whiteboard:
Depends On:
Blocks: sat541-blockers 703377
TreeView+ depends on / blocked
 
Reported: 2011-01-21 15:01 UTC by Paresh Mutha
Modified: 2018-12-09 16:43 UTC (History)
14 users (show)

Fixed In Version: spacewalk-schema-1.2.21-11 satellite-schema-5.4.0.11-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 703377 (view as bug list)
Environment:
Last Closed: 2011-06-17 02:46:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paresh Mutha 2011-01-21 15:01:35 UTC
Description of problem:
As a Satellite Administrator, going to the page Organization -> Subscriptions -> Software Channel Entitlements to adjust the software channel entitlements, it fails to load with an Internal Server Error.

Version-Release number of selected component (if applicable):
RHN Satellite v5.4

How reproducible:
Always

Steps to Reproduce:
1] log on as satellite administrator
2] choose an organization 
3] click on the "Subscriptions"
4] click on the "Software Channel Entitlements"

Actual results:
Fails to load. Internal Server Error is displayed

Expected results:
Software Channel Entitlments usage and options to adjust the number of entitlements should be displayed.

Additional info:
Traceback in catalina.out :

2010-12-07 15:11:23,060 [TP-Processor1] WARN  org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerException
2010-12-07 15:11:23,060 [TP-Processor1] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
javax.servlet.ServletException
	at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
	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 

..snip..

Caused by: 
java.lang.NullPointerException
	at com.redhat.rhn.frontend.dto.ChannelOverview.getMaxMembers(ChannelOverview.java:210)
	at com.redhat.rhn.frontend.dto.OrgChannelFamily.getMaxAvailable(OrgChannelFamily.java:130)
	at com.redhat.rhn.frontend.action.multiorg.OrgSoftwareSubscriptionsAction.execute(OrgSoftwareSubscriptionsAction.java:82)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	... 40 more
2010-12-07 15:11:23,064 [TP-Processor1] 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.dto.ChannelOverview.getMaxMembers(ChannelOverview.java:210)
	at com.redhat.rhn.frontend.dto.OrgChannelFamily.getMaxAvailable(OrgChannelFamily.java:130)
	at com.redhat.rhn.frontend.action.multiorg.OrgSoftwareSubscriptionsAction.execute(OrgSoftwareSubscriptionsAction.java:82)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

Comment 4 Jan Pazdziora (Red Hat) 2011-01-26 15:44:52 UTC
Giving to Tomáš.

Comment 5 Jan Pazdziora (Red Hat) 2011-01-27 07:49:26 UTC
Paresh,

did you investigate why (in which situation) does the setMaxFlex
and/or setMaxMembers get called with null? Shouldn't/couldn't we
handle this on the caller's side, rather than in the setter?

Thanks,

Jan

Comment 6 Paresh Mutha 2011-01-27 09:00:27 UTC
Hi Jan,

I did try to check the calls made to setMaxMembers but wasn't able to get to the situation where it was passing null. Currently I see that these are the 4 calls to setMaxMembers in ChannelManager.java

listChannelFamilySubscriptionsFor	265 ocf.setMaxMembers(new Long(0));

listChannelFamilySubscriptionsFor	271 ocf.setMaxMembers(orgo.getMaxMembers());

makeOrgSoftwareEntitlement		366 seDto.setMaxMembers(co.getMaxMembers());

listEntitlementsForAllOrgsWithEmptyOrgs	429 seDto.setMaxMembers(0L);

But these didn't seem like null being passed to setMaxMembers. So I couldn't move ahead on this part. I can try adding few more debug statements at these calls and try to check but I am not sure how much would it help.

..snip from ChannelManager.java ..

    251         for (ChannelOverview sato : satEntitlements) {
    252             OrgChannelFamily ocf = new OrgChannelFamily();
    253 
    254             ocf.setSatelliteCurrentMembers(sato.getCurrentMembers());
    255             ocf.setSatelliteMaxMembers(sato.getMaxMembers());
    256             ocf.setSatelliteCurrentFlex(sato.getCurrentFlex());
    257             ocf.setSatelliteMaxFlex(sato.getMaxFlex());
    258             ocf.setId(sato.getId());
    259             ocf.setName(sato.getName());
    260             ocf.setLabel(sato.getLabel());
    261 
    262             ChannelOverview orgo =  orgMap.get(sato.getId());
    263             if (orgo == null) {
    264                 ocf.setCurrentMembers(new Long(0));
    265                 ocf.setMaxMembers(new Long(0));
    266                 ocf.setMaxFlex(0L);
    267                 ocf.setCurrentFlex(0L);
    268             }
    269             else {
    270                 ocf.setCurrentMembers(orgo.getCurrentMembers());
    271                 ocf.setMaxMembers(orgo.getMaxMembers());
    272                 ocf.setMaxFlex(orgo.getMaxFlex());
    273                 ocf.setCurrentFlex(orgo.getCurrentFlex());
    274             }
    275             if (ocf.getSatelliteMaxMembers() != null) {
    276               ret.add(ocf);
    277             }
    278         }

..snip from ChannelManager.java ..

- Paresh

Comment 7 Tomas Lestach 2011-01-27 12:51:05 UTC
Hello Paresh, thank you for your patch. I managed to reproduce the problem.

spacewalk.git: 2f08c0d2bce55c42ade13ab6ee4caeb7dd6847c1

I will discuss with Justin, whether we want to make more changes regarding this problem.

Comment 8 Tomas Lestach 2011-01-27 16:59:50 UTC
Hello Paresh,

please, ignore my previous comment.
We've discussed the patch and found out, it's not correct. I reverted the commit: cffab0bd9315a933d24afc4e8cf9feab7a85929b

Comment 19 Tomas Lestach 2011-03-30 17:16:38 UTC
One note to the reproducer described in Comment#17:

Point 4.) I had to change "Regular Proposed Total" for "RHEL AP for SAP" rhel-server-sap to a non-zero number (f.e. 1) and press "Update Organization".

Otherwise the reproducer is great and thank Tasos for it!

The attached patches aren't ok! They prevent the WebUI from getting the ISE, but they may harm custom channel entitlements under some circumstances. It's highly not recommended to apply/use them!

Fix is in the set_family_count stored procedure:
spacewalk.git: 31be7a0ff19f81bfddff054677b52a92fc156de0
spacewalk.git: f39492327788288c106b6a8fc7db5000a9b72eee (PG)

Comment 32 Dimitar Yordanov 2011-06-06 12:23:54 UTC
Verified on Stage with Cert:

bucknell-university.cert
redhat-cperry-errata-stage-rhel6-flex.cert

Comment 33 Clifford Perry 2011-06-17 02:46:53 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.

https://rhn.redhat.com/errata/RHEA-2011-0875.html


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