Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1202896

Summary: Subscriptions page shows incorrect counts
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: Subscription ManagementAssignee: Tom McKay <tomckay>
Status: CLOSED DUPLICATE QA Contact: sthirugn <sthirugn>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: alikins, dgoodwin, mmccune, mstead, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-25 12:19:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sthirugn@redhat.com 2015-03-17 16:19:14 UTC
Description of problem:
Subscriptions page shows incorrect counts

Version-Release number of selected component (if applicable):
Satellite-6.1.0-RHEL-6-20150311.1

How reproducible:
Always

Steps to Reproduce:
1. Install Sat6
2. Upload manifest (with RH employee subscriptions), enable repositories, sync
3. Create activation key, attach subscriptions
4. Register three different content hosts
5. Subscriptions page showed correct consumed counts
- 3 consumed subscriptions
- 3 unlimited guest subscriptions corresponding to 3 content hosts
6. Unregister all three content hosts
7. Review the subscriptions page (see screenshot)

Actual results:
1. Unlimited guest subscriptions does not go away
2. Consumed subscriptions shows 1 although I did not have any content hosts registered

Expected results:
1. Unlimited guest subscriptions should go away when the corresponding content host is unregistered
2. If I dont have any content host, I should see zero subscriptions consumed

Additional info:

Comment 6 Adrian Likins 2015-03-18 18:24:37 UTC
Quick glance in the logs reveal lots of :

2015-03-17 12:06:11,875 [=, org=] ERROR org.candlepin.audit.AMQPBusPublisher - Unable to send event: Event [id=null, t
arget=CONSUMER, type=DELETED, time=Tue Mar 17 12:06:11 EDT 2015, entity=8a90e0044c0f617e014c1513219307c8]
javax.jms.IllegalStateException: Object org.apache.qpid.client.AMQSession_0_10@598529e5 has been closed
        at org.apache.qpid.client.Closeable.checkNotClosed(Closeable.java:62) ~[qpid-client-0.30.redhat-1.jar:0.30.red
hat-1]
        at org.apache.qpid.client.AMQSession.checkNotClosed(AMQSession.java:549) ~[qpid-client-0.30.redhat-1.jar:0.30.
redhat-1]
        at org.apache.qpid.client.AMQSession.createTextMessage(AMQSession.java:1599) ~[qpid-client-0.30.redhat-1.jar:0
.30.redhat-1]
        at org.apache.qpid.client.AMQSession.createTextMessage(AMQSession.java:1614) ~[qpid-client-0.30.redhat-1.jar:0
.30.redhat-1]
        at org.apache.qpid.client.AMQSessionAdapter.createTextMessage(AMQSessionAdapter.java:77) ~[qpid-client-0.30.re
dhat-1.jar:0.30.redhat-1]
        at org.candlepin.audit.AMQPBusPublisher.onEvent(AMQPBusPublisher.java:60) ~[AMQPBusPublisher.class:na]
        at org.candlepin.audit.ListenerWrapper.onMessage(ListenerWrapper.java:52) [ListenerWrapper.class:na]
        at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1114) [hornetq-core-c
lient-2.3.5.Final-redhat-2.jar:2.3.5.Final-redhat-2]
        at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:57) [hornetq-core-client
-2.3.5.Final-redhat-2.jar:2.3.5.Final-redhat-2]
        at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1249) [hornetq-core-clie
nt-2.3.5.Final-redhat-2.jar:2.3.5.Final-redhat-2]
        at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:106) [hornetq-co
re-client-2.3.5.Final-redhat-2.jar:2.3.5.Final-redhat-2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]

Comment 7 Adrian Likins 2015-03-18 18:45:30 UTC
Timeframe of the screenshot in attachement 1?

Comment 8 Adrian Likins 2015-03-19 14:01:30 UTC
Looking through the candlepin audit.log, I see the consumers registered and consuming subs with a created entitlement, but then also see each of them unattach the entitlements. It looks like everything get's deleted but it could be missing something.

Comment 9 Michael Stead 2015-03-23 11:55:05 UTC
These errors should fail gracefully and not cause any issues in the candlepin transaction. The failed event sending should get queued up and retried when the connection to the broker is made again.

Unless the event failure handling is broken, I don't see how this could be causing the counts to be off. These counts should be coming from the current status of the pool/subscription, not from gutterball.

Comment 10 Devan Goodwin 2015-03-25 12:19:21 UTC
Based on what we've seen leading to bug #1205378, this appears to be data from a Katello search index cache. The cache is updated when events are received, so events not being sent could cause the cache to not be updated.

I suspect running 'foreman-rake katello:reindex' will clear the issue up.

In the foreman debug for this issue, there are several failed events including 3 entitlements deleted that never made it to the message bus. This very likely indicates why Katello thought there were still three in use.

If you were to restart qpid, and then tomcat, all queued events should be sent out, which should also clear this up. 

The likely cause was a qpid restart without a tomcat restart, or possibly some kind of qpid crash though that is less commonly seen.

We're already working on more resiliency keeping connections open to the qpid message bus, as such I think I'm going to close this as a dupe as that appears to be the case here.

*** This bug has been marked as a duplicate of bug 1200877 ***

Comment 11 sthirugn@redhat.com 2015-04-13 17:53:05 UTC
Clearing needinfo? flag as the other related bug https://bugzilla.redhat.com/show_bug.cgi?id=1200877 is verified.