Bug 738448

Summary: missing an expected message when attempting to unregister a person consumer while entitlements are being consumed
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED WONTFIX QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: bkearney, skallesh, spandey
Target Milestone: betaKeywords: Regression
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-03 14:21:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 840699, 863175    

Description John Sefler 2011-09-14 19:46:59 UTC
Description of problem:
This regression was discovered by an automated test.
The following is a recent example of the stdout message printed when a person consumer attempts to unregister while entitlement are being consumed from a pool that was derived from the person pool...


[root@jsefler-onprem-62server ~]# subscription-manager unregister

-Cannot unsubscribe entitlement '8a90f8c6326898fe01326950f21c110e' because:
  system consumer 'jsefler-onprem-62workstation.usersys.redhat.com' with id '07a4ef4c-886d-465e-8dde-523c87994f18' has the following entitlements:
    Entitlement '8a90f8c6326898fe0132695220de11ad':
        account number: '12331131231'
        serial number: '606,546,989,978,330,633'
  system consumer 'jsefler-onprem-62workstation.usersys.redhat.com' with id 'e90f3777-df2a-48da-8e0e-2c36c2000059' has the following entitlements:
    Entitlement '8a90f8c6326898fe01326951da4e1186':
        account number: '12331131231'
        serial number: '2,169,828,362,283,997,365'
  system consumer 'jsefler-onprem-62workstation.usersys.redhat.com' with id '86e4e2a3-e2da-4c7f-a2fe-3ee4cbba22d6' has the following entitlements:
    Entitlement '8a90f8c6326898fe0132695190d0115f':
        account number: '12331131231'
        serial number: '1,333,553,684,530,365,932'
  system consumer 'jsefler-onprem-62workstation.usersys.redhat.com' with id '85c7b4bd-143b-4843-9a1d-8072bd05d488' has the following entitlements:
    Entitlement '8a90f8c6326898fe013269513c771138':
        account number: '12331131231'
        serial number: '4,389,885,156,835,146,406'

These consumed entitlements were derived from subscription pool: '8a90f8c6326898fe0132689acef6034c'.
You must first unsubscribe these consumers from these entitlements.

[root@jsefler-onprem-62server ~]# 


THE PROBLEM IS THAT THE SAME MESSAGE ABOVE USED TO BEGIN WITH THIS PREFIXING MESSASGE:
Cannot unregister person consumer testuser1 because: 
Cannot unregister {0} consumer {0} because: 

SO CLEARLY SOMETHING HAS CHANGED.  DID THIS ONE-LINER MESSAGE GET ELIMINATED ON PURPOSE OR BY ACCIDENT?  I DON"T SEE A REASON WHY IT SHOULD HAVE CHANGED.

I SUSPECT A RECENT MERGE OF TRANSLATION FILES COULD BE THE CAUSE.  POSSIBLY FROM ONE OF THESE COMMITS:
 413da34b85b61090f18969d1c320490aa3dc9a3f for candlepin
 35e8304de290676f96338e7affcd3eec4a981949 for subscription-manager


Version-Release number of selected component (if applicable):
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.9-1.git.14.2a3eecb.el6.x86_64
candlepin master ee618c37f277cf766e299edd8ea5f070d625f249

Comment 2 John Sefler 2011-09-14 19:51:55 UTC
Related bug...  In the big message above the serial numbers are rendered with commas:
          serial number: '4,389,885,156,835,146,406'

This is not useful and confusing since we use the serial number to unsubscribe and it better not have any commas when we attempt the unsubscribe.  Can you filter out the commas from the serial numbers in the message?

Comment 5 John Sefler 2011-11-02 16:29:59 UTC
Update...  the behavior in the scenario of comment 0 has worsened to a RuntimeError...

Versions...
[root@jsefler-onprem-62candlepin candlepin]# git branch
  0.3
* 0.4
  master
[root@jsefler-onprem-62candlepin candlepin]# git show | head -1
commit 7cb7dbe8d5e2892dcbcbf3d77a61541ca221c18f

candlepin 0.4.25

[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64


201111021229:26.300 - FINE: ssh root@jsefler-onprem-62server.usersys.redhat.com subscription-manager unregister
201111021229:27.152 - FINE: Stdout: Runtime Error null at java.util.HashMap$HashIterator.nextEntry:810
201111021229:27.154 - FINE: Stderr:  
201111021229:27.156 - FINE: ExitCode: 255 


Here is the trace in catalina.out...
Nov 02 12:28:16 [http-8443-5] WARN  org.fedoraproject.candlepin.auth.interceptor.SecurityInterceptor - Allowing invocation to proceed with no authentication required.
Nov 02 12:28:23 [http-8443-5] WARN  org.fedoraproject.candlepin.auth.interceptor.SecurityInterceptor - Allowing invocation to proceed with no authentication required.
Nov 02 12:28:23 [http-8443-5] WARN  org.fedoraproject.candlepin.policy.js.entitlement.EntitlementRules - No default rule found: post_global
Nov 02 12:28:23 [http-8443-5] WARN  org.fedoraproject.candlepin.policy.js.JsRules - No rule found: post_global in namespace: unbind_name_space
Nov 02 12:28:23 [http-8443-5] ERROR org.fedoraproject.candlepin.exceptions.CandlepinExceptionMapper - Runtime exception:
java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:810)
	at java.util.HashMap$KeyIterator.next(HashMap.java:845)
	at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:577)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager.removeEntitlement(CandlepinPoolManager.java:626)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.CGLIB$removeEntitlement$18(<generated>)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826$$FastClassByGuice$$dc4e4859.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.wideplay.warp.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.removeEntitlement(<generated>)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager.revokeEntitlement(CandlepinPoolManager.java:655)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.CGLIB$revokeEntitlement$3(<generated>)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826$$FastClassByGuice$$dc4e4859.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.wideplay.warp.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.revokeEntitlement(<generated>)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager.revokeAllEntitlements(CandlepinPoolManager.java:662)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.CGLIB$revokeAllEntitlements$4(<generated>)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826$$FastClassByGuice$$dc4e4859.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.wideplay.warp.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
	at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$edcb826.revokeAllEntitlements(<generated>)
	at org.fedoraproject.candlepin.resource.ConsumerResource.deleteConsumer(ConsumerResource.java:781)
	at org.fedoraproject.candlepin.resource.ConsumerResource$$EnhancerByGuice$$d26a4f8c.CGLIB$deleteConsumer$8(<generated>)
	at org.fedoraproject.candlepin.resource.ConsumerResource$$EnhancerByGuice$$d26a4f8c$$FastClassByGuice$$46e38972.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at org.fedoraproject.candlepin.auth.interceptor.SecurityInterceptor.invoke(SecurityInterceptor.java:112)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.wideplay.warp.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:68)
	at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
	at com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
	at org.fedoraproject.candlepin.resource.ConsumerResource$$EnhancerByGuice$$d26a4f8c.deleteConsumer(<generated>)
	at sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:216)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:141)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:63)
	at org.fedoraproject.candlepin.servlet.filter.ContentTypeHackFilter.doFilter(ContentTypeHackFilter.java:61)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at org.fedoraproject.candlepin.servlet.filter.VersionFilter.doFilter(VersionFilter.java:47)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at org.fedoraproject.candlepin.servlet.filter.logging.LoggingFilter.doFilter(LoggingFilter.java:60)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141)
	at com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
	at com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
	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:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:679)
^C
[root@jsefler-onprem-62candlepin candlepin]#

Comment 9 Bryan Kearney 2012-10-23 21:04:19 UTC
Per discussion with sefler, pushing htis out since we do not use the personal consumer features.