Bug 1466493 - nonlinux_entitlement creates null pointer after returning from EntitlementManager class
nonlinux_entitlement creates null pointer after returning from EntitlementMan...
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI (Show other bugs)
580
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Tomáš Kašpárek
Ales Dujicek
:
Depends On:
Blocks: sat58-errata 1479337
  Show dependency treegraph
 
Reported: 2017-06-29 15:37 EDT by Shannon Hughes
Modified: 2017-10-19 07:57 EDT (History)
11 users (show)

See Also:
Fixed In Version: satellite-schema-5.8.0.34-1-sat spacewalk-schema-2.5.1-51-sat
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1479337 (view as bug list)
Environment:
Last Closed: 2017-10-19 07:57:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3193442 None None None 2017-09-22 15:53 EDT
Red Hat Product Errata RHBA-2017:2915 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2017-10-19 11:56:50 EDT

  None (edit)
Description Shannon Hughes 2017-06-29 15:37:40 EDT
Description of problem:

looks like we have some old 5.7 entitlement data coming into 5.8 after upgrade and causing a NPE due to removing a check for ( git hash 3328ffef4d3c7fdf60519de477e80062672fed0b ) nonlinux_entitlement. When viewing both the System Entitlements page and also looking at SDC properties page. 


2017-06-28 14:59:06,382 [TP-Processor2] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
javax.el.ELException: Error reading 'name' on type com.redhat.rhn.frontend.dto.SystemEntitlementsDto
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:66)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
	at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
	at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:913)
	at org.apache.jsp.WEB_002dINF.pages.admin.multiorg.sys_005fentitlements_jsp._jspx_meth_rl_005fcolumn_005f0(Unknown Source)
	at org.apache.jsp.WEB_002dINF.pages.admin.multiorg.sys_005fentitlements_jsp._jspx_meth_rl_005flist_005f0(Unknown Source)
	at org.apache.jsp.WEB_002dINF.pages.admin.multiorg.sys_005fentitlements_jsp._jspx_meth_rl_005flistset_005f0(Unknown Source)
	at org.apache.jsp.WEB_002dINF.pages.admin.multiorg.sys_005fentitlements_jsp._jspService(Unknown Source)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1083)
	at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
	at com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:105)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:127)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:57)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:299)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
	at java.lang.Thread.run(Thread.java:785)
Caused by: 
java.lang.NullPointerException
	at com.redhat.rhn.frontend.dto.SystemEntitlementsDto.getName(SystemEntitlementsDto.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:508)
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)



as well as 


java.lang.NullPointerException
	at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.createBaseEntitlementDropDownList(SystemDetailsEditAction.java:406)
	at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.setupPageAndFormValues(SystemDetailsEditAction.java:309)
	at com.redhat.rhn.frontend.action.systems.sdc.SystemDetailsEditAction.execute(SystemDetailsEditAction.java:120)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
	... 40 more
	... 58 more

In the EntitlementManager, 

@@ -95,9 +92,6 @@ public class EntitlementManager extends BaseManager {
         else if (PROVISIONING_ENTITLED.equals(name)) {
             return PROVISIONING;
         }
-        else if (NONLINUX_ENTITLED.equals(name)) {
-            return NONLINUX;
-        }
         else if (VIRTUALIZATION_ENTITLED.equals(name)) {
             return VIRTUALIZATION;

we return null shortly after if entitlement is not found, and this is causing the null pointer. 

schema upgrade looks to be on 5.8 and is version satellite-schema-5.8.0.31-1.el6sat. No errors in the schema upgrade log so imagine we need to make a fix to schema upgrade to catch the non linux entitlement data.
Comment 2 Shannon Hughes 2017-06-29 15:51:19 EDT
we removed the record in rhnServerGroup and rhnServerGroupType for the nonlinux entitlement and fixed the ISE. imagine we need to do something similar in the schema upgrade process
Comment 3 Neal Kim 2017-06-29 16:12:02 EDT
The rhnOrgEntitlementType might also need to be cleaned up as well.
Comment 14 Tomáš Kašpárek 2017-08-08 07:41:22 EDT
spacewalk.git(master): 79a9d1e75f7c834282ba777a0a7f1b56e7194703
Comment 15 Tomáš Kašpárek 2017-08-08 07:59:23 EDT
spacewalk.git(master): 9489e02a13879dadff89c09840bcb6ff1b522f64
Comment 22 errata-xmlrpc 2017-10-19 07:57:19 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2915

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