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)
Giving to Tomáš.
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
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
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.
Hello Paresh, please, ignore my previous comment. We've discussed the patch and found out, it's not correct. I reverted the commit: cffab0bd9315a933d24afc4e8cf9feab7a85929b
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)
Verified on Stage with Cert: bucknell-university.cert redhat-cperry-errata-stage-rhel6-flex.cert
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