Bug 199502 - ISE on SysEntitlements page when MaxMembers = Null
ISE on SysEntitlements page when MaxMembers = Null
Status: CLOSED CURRENTRELEASE
Product: Red Hat Network
Classification: Red Hat
Component: RHN/Web Site (Show other bugs)
rhn410
All Linux
high Severity high
: ---
: ---
Assigned To: Partha Aji
wes hayutin
http://rhn.webqa.redhat.com/rhn/Syste...
:
Depends On:
Blocks: 166615
  Show dependency treegraph
 
Reported: 2006-07-19 18:36 EDT by Partha Aji
Modified: 2007-03-13 13:49 EDT (History)
3 users (show)

See Also:
Fixed In Version: rhn500h
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-13 13:49:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Partha Aji 2006-07-19 18:36:32 EDT
Description of problem:
For the user mibanescu/redhat or any user who has (rhnServerGroup.MAX_MEMBERS =
null), the server will throw an ISE when accessing SystemEntitlements.do..
http://rhn.webqa.redhat.com/rhn/SystemEntitlements.do

Version-Release number of selected component (if applicable):
rhn410, 415, 420 
Both hosted and Satellite

How reproducible:
Always

Steps to Reproduce:
1. login as mibanescu/redhat (or any user who has a rhnServerGroup entry with
max_members set to null)
2. On YourRhn page select Susbscription Management

Expected results:
A list of systems whose entitlements can be changed..

Actual results:
Internal Service Error.. 

2006-07-19 18:43:43,735 [TP-Processor1] WARN 
org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class
java.lang.NullPointerException
2006-07-19 18:43:43,770 [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:236)
	at
com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:70)
	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:743)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:136)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at com.redhat.rhn.frontend.servlets.ContextFilter.doFilter(ContextFilter.java:98)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	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:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:52)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:88)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
	at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
	at
com.redhat.rhn.frontend.action.systems.entitlements.SystemEntitlementsSetupAction.setIfSlotsAvailable(SystemEntitlementsSetupAction.java:144)
	at
com.redhat.rhn.frontend.action.systems.entitlements.SystemEntitlementsSetupAction.execute(SystemEntitlementsSetupAction.java:93)
	at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	... 51 more
2006-07-19 18:43:43,924 [TP-Processor1] DEBUG net.rkbloom.logdriver.LogStatement
- Executing: ALTER SESSION SET OPTIMIZER_GOAL=RULE
2006-07-19 18:43:43,927 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select websession0_.id as id86_0_, websession0_.value as value86_0_,
websession0_.web_user_id as web3_86_0_, websession0_.expires as expires86_0_
from PXTSessions websession0_ where websession0_.id=?' with bind parameters:
{1=2658463631}
2006-07-19 18:43:43,942 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select legacyrhnu0_.id as id69_3_, legacyrhnu0_.login as login69_3_,
legacyrhnu0_.login_uc as login3_69_3_, legacyrhnu0_.password as password69_3_,
legacyrhnu0_.created as created69_3_, legacyrhnu0_.modified as modified69_3_,
legacyrhnu0_.org_id as org7_69_3_, personalin1_.web_user_id as web1_67_0_,
personalin1_.prefix as prefix67_0_, personalin1_.first_names as first3_67_0_,
personalin1_.last_name as last4_67_0_, personalin1_.company as company67_0_,
personalin1_.title as title67_0_, personalin1_.phone as phone67_0_,
personalin1_.fax as fax67_0_, personalin1_.email as email67_0_,
personalin1_.created as created67_0_, personalin1_.modified as modified67_0_,
orgimpl2_.id as id132_1_, orgimpl2_.name as name132_1_, orgimpl2_.password as
password132_1_, orgimpl2_.oracle_customer_id as oracle4_132_1_,
orgimpl2_.oracle_customer_number as oracle5_132_1_, orgimpl2_.customer_type as
customer6_132_1_, orgimpl2_.created as created132_1_,
orgimpl2_.credit_application_completed as credit8_132_1_, orgimpl2_.modified as
modified132_1_, entitlemen3_.org_id as org1_5_, orgentitle4_.id as entitlem2_5_,
orgentitle4_.id as id136_2_, orgentitle4_.label as label136_2_,
orgentitle4_.name as name136_2_, orgentitle4_.created as created136_2_,
orgentitle4_.modified as modified136_2_ from WEB_CONTACT legacyrhnu0_ inner join
WEB_USER_PERSONAL_INFO personalin1_ on legacyrhnu0_.id=personalin1_.web_user_id
inner join WEB_CUSTOMER orgimpl2_ on legacyrhnu0_.org_id=orgimpl2_.id left outer
join rhnOrgEntitlements entitlemen3_ on orgimpl2_.id=entitlemen3_.org_id left
outer join RHNORGENTITLEMENTTYPE orgentitle4_ on
entitlemen3_.entitlement_id=orgentitle4_.id where legacyrhnu0_.id=?' with bind
parameters: {1=575937}
2006-07-19 18:43:43,953 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select orgquota0_.org_id as org1_137_2_, orgquota0_.total as total137_2_,
orgquota0_.bonus as bonus137_2_, orgquota0_.used as used137_2_,
orgquota0_.created as created137_2_, orgquota0_.modified as modified137_2_,
orgimpl1_.id as id132_0_, orgimpl1_.name as name132_0_, orgimpl1_.password as
password132_0_, orgimpl1_.oracle_customer_id as oracle4_132_0_,
orgimpl1_.oracle_customer_number as oracle5_132_0_, orgimpl1_.customer_type as
customer6_132_0_, orgimpl1_.created as created132_0_,
orgimpl1_.credit_application_completed as credit8_132_0_, orgimpl1_.modified as
modified132_0_, entitlemen2_.org_id as org1_4_, orgentitle3_.id as entitlem2_4_,
orgentitle3_.id as id136_1_, orgentitle3_.label as label136_1_,
orgentitle3_.name as name136_1_, orgentitle3_.created as created136_1_,
orgentitle3_.modified as modified136_1_ from rhnOrgQuota orgquota0_ inner join
WEB_CUSTOMER orgimpl1_ on orgquota0_.org_id=orgimpl1_.id left outer join
rhnOrgEntitlements entitlemen2_ on orgimpl1_.id=entitlemen2_.org_id left outer
join RHNORGENTITLEMENTTYPE orgentitle3_ on
entitlemen2_.entitlement_id=orgentitle3_.id where orgquota0_.org_id=?' with bind
parameters: {1=1198839}
2006-07-19 18:43:43,976 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select userinfo0_.user_id as user1_66_0_, userinfo0_.page_size as page2_66_0_,
userinfo0_.use_pam_authentication as use3_66_0_, userinfo0_.email_notify as
email4_66_0_, userinfo0_.show_system_group_list as show5_66_0_,
userinfo0_.last_logged_in as last6_66_0_, userinfo0_.created as created66_0_,
userinfo0_.modified as modified66_0_, userinfo0_.preferred_locale as
preferred9_66_0_, userinfo0_.timezone_id as timezone10_66_0_ from RHNUSERINFO
userinfo0_ where userinfo0_.user_id=?' with bind parameters: {1=575937}
2006-07-19 18:43:43,992 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select usergroups0_.org_id as org5_1_, usergroups0_.id as id1_, usergroups0_.id
as id135_0_, usergroups0_.name as name135_0_, usergroups0_.description as
descript3_135_0_, usergroups0_.current_members as current4_135_0_,
usergroups0_.org_id as org5_135_0_, usergroups0_.created as created135_0_,
usergroups0_.modified as modified135_0_, usergroups0_.group_type as
group8_135_0_ from RHNUSERGROUP usergroups0_ where usergroups0_.org_id=?' with
bind parameters: {1=1198839}
2006-07-19 18:43:44,014 [TP-Processor1] DEBUG
net.rkbloom.logdriver.LogPreparedStatement - executing PreparedStatement:
'select usergroups0_.user_id as user1_0_, usergroups0_.user_group_id as user2_0_
from rhnUserGroupMembers usergroups0_ where usergroups0_.user_id=?' with bind
parameters: {1=575937}
2006-07-19 18:43:44,070 [RHN Message Dispatcher] ERROR
com.redhat.rhn.common.messaging.MessageDispatcher - Error occurred with an event
in the MessageQueue
java.lang.NullPointerException
	at
com.redhat.rhn.frontend.events.TraceBackAction.getRecipients(TraceBackAction.java:59)
	at com.redhat.rhn.frontend.events.BaseMailAction.execute(BaseMailAction.java:37)
	at com.redhat.rhn.common.messaging.ActionExecutor.run(ActionExecutor.java:47)
	at com.redhat.rhn.common.messaging.MessageDispatcher.run(MessageDispatcher.java:54)
	at java.lang.Thread.run(Thread.java:595)
2006-07-19 18:43:44,070 [RHN Message Dispatcher] ERROR
com.redhat.rhn.common.messaging.MessageDispatcher - Error sending traceback
email, logging for posterity.
java.lang.NullPointerException
	at
com.redhat.rhn.frontend.events.TraceBackAction.getRecipients(TraceBackAction.java:59)
	at com.redhat.rhn.frontend.events.BaseMailAction.execute(BaseMailAction.java:37)
	at com.redhat.rhn.common.messaging.MessageDispatcher.run(MessageDispatcher.java:74)
	at java.lang.Thread.run(Thread.java:595)




Additional info:
Comment 1 Partha Aji 2006-07-19 20:02:37 EDT
Fixed this in trunk as of revision 98130..

System Entitlments assumed that a server group's max slots was always going to
be a valid positive number. Apparently in the case where a servergroup can have
"unlimited" slots, the Max_Members is set to null.. 

This should be resolved in 420..

Porting to rhn 410-415 remains to be seen..
Comment 2 Mihai Ibanescu 2006-07-20 08:33:16 EDT
Here's a bit more data from production:

select name from rhnServerGroupType where id = 3;
NAME
----------------------------------------------------------------
RHN Management Entitled Servers


(this is the enterprise_entitled group type)

select org_id from rhnServerGroup where group_type = 3 and max_members is null;

    ORG_ID
----------
   1198839
   2058528
   4181934
select login from web_contact where org_id in (1198839, 2058528, 4181934);

LOGIN
----------------------------------------------------------------
rhn-internal
nick.hansen
nick.hansen01
nickhansen02
mibanescu
mibanescu-channel-admin
mibanescu-plain

OK, are there any other entitlement groups that have max_members null?

select sg.org_id, sgt.label from rhnServerGroupType sgt, rhnServerGroup sg where
sg.group_type = sgt.id and sg.max_members is null;

    ORG_ID LABEL
---------- --------------------------------
   2058528 enterprise_entitled
   1198839 enterprise_entitled
   4181934 enterprise_entitled


Nope, we're good. Only rhn-internal, my account and Nick's are this way.

At this point, I'd actually try to fix the data in production and remove this
corner case, since 1. nick shouldn't have unlimited management 2. neither should
I 3. rhn-internal is probably not used anymore 4. we probably need a constraint
there, but that would break server group membership because we chose to
represent entitlements in a way too general way.

Comment 3 Partha Aji 2007-02-15 17:16:48 EST
Moving to ON_QA
Comment 4 Partha Aji 2007-02-15 17:18:42 EST
Moving to ON_QA
Comment 5 wes hayutin 2007-02-19 09:03:00 EST
looks good
Comment 6 wes hayutin 2007-03-09 20:55:33 EST
I'm not sure I can test this in stage... leaving it for now
Comment 7 Brandon Perkins 2007-03-13 10:15:58 EDT
Closed in rhn500h Release.
Comment 8 Brandon Perkins 2007-03-13 13:49:36 EDT
Closed in rhn500h release.

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