Bug 919700 - deleted consumer uuid lives on to prevent new consumer from autosubscribing
Summary: deleted consumer uuid lives on to prevent new consumer from autosubscribing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.10
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: beta
: 5.10
Assignee: Devan Goodwin
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510 rhsm-2013
TreeView+ depends on / blocked
 
Reported: 2013-03-09 16:30 UTC by John Sefler
Modified: 2013-10-01 13:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-01 13:50:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Sefler 2013-03-09 16:30:55 UTC
Description of problem:
After the recent merge of the server-side compliance work for subscription-manager, the following scenario has regressed...

 register thereby creating a consumer
 register with force and autosubscribe

The problem appears to be that the register with force will delete the current consumer and then register a new consumer, but the attempt to autosubscribe is blocked by the first consumer (who is now deleted).  See reproduce steps below...

Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.8.3-1.git.233.1eec8ec.el7.x86_64
python-rhsm-1.8.7-1.git.1.675a611.el7.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager unregister
This system is currently not registered.
[root@jsefler-7 ~]# subscription-manager register --username=testuser1 --password=password --org=admin
The system has been registered with id: a49525ec-0990-4822-9b5f-68c1a51108d0 
[root@jsefler-7 ~]# subscription-manager register --username=testuser1 --password=password --org=admin --force --autosubscribe
The system with UUID a49525ec-0990-4822-9b5f-68c1a51108d0 has been unregistered
The system has been registered with id: 277fb322-8a68-4aec-8010-d38ea9d3cb8a 
Consumer a49525ec-0990-4822-9b5f-68c1a51108d0 has been deleted
[root@jsefler-7 ~]# 

  
Actual results:
 Notice in the output above, the request to autosubscribe never occurred.  It appears to have been blocked by a dirty consumer id.



Additional info:
[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log

2013-03-09 11:20:12,606 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-03-09 11:20:12,606 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-03-09 11:20:12,606 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-03-09 11:20:12,607 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-compat-rhel64.pem'
2013-03-09 11:20:12,607 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-03-09 11:20:12,608 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-03-09 11:20:12,609 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/277fb322-8a68-4aec-8010-d38ea9d3cb8a/certificates/serials
2013-03-09 11:20:12,736 [DEBUG]  @connection.py:434 - Response status: 200
2013-03-09 11:20:12,744 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-03-09 11:20:12,746 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-03-09 11:20:12,747 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-03-09 11:20:12,747 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-compat-rhel64.pem'
2013-03-09 11:20:12,748 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-03-09 11:20:12,749 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-03-09 11:20:12,750 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/277fb322-8a68-4aec-8010-d38ea9d3cb8a/certificates?serials=911833055825825507,6728845554114183468,6297957017565433269,751148331816239414,1281371030204560100,3748913037183301785,3522455560927288754,6081731027013795606,4923339018031472805
2013-03-09 11:20:12,887 [DEBUG]  @connection.py:434 - Response status: 200
2013-03-09 11:20:12,905 [INFO]  @certlib.py:236 - certs updated:
Total updates: 9
Found (local) serial# []
Expected (UEP) serial# [911833055825825507, 6728845554114183468, 6297957017565433269, 751148331816239414, 1281371030204560100, 3748913037183301785, 3522455560927288754, 6081731027013795606, 4923339018031472805]
Added (new)
  [sn:911833055825825507 (Exempt Product Bits,) @ /etc/pki/entitlement/911833055825825507.pem]
  [sn:6728845554114183468 (Shared File System Bits,) @ /etc/pki/entitlement/6728845554114183468.pem]
  [sn:6297957017565433269 (RAM Limiting Product,) @ /etc/pki/entitlement/6297957017565433269.pem]
  [sn:751148331816239414 (Awesome OS for x86_64 Bits,) @ /etc/pki/entitlement/751148331816239414.pem]
  [sn:1281371030204560100 (Stackable with Awesome OS for x86_64 Bits,) @ /etc/pki/entitlement/1281371030204560100.pem]
  [sn:3748913037183301785 (Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits,) @ /etc/pki/entitlement/3748913037183301785.pem]
  [sn:3522455560927288754 (Awesome OS Modifier Bits,) @ /etc/pki/entitlement/3522455560927288754.pem]
  [sn:6081731027013795606 (Clustering Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:6081731027013795606 (Awesome OS Server Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:6081731027013795606 (Load Balancing Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:6081731027013795606 (Large File Support Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:6081731027013795606 (Shared Storage Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:6081731027013795606 (Management Bits,) @ /etc/pki/entitlement/6081731027013795606.pem]
  [sn:4923339018031472805 (Awesome OS Workstation Bits,) @ /etc/pki/entitlement/4923339018031472805.pem]
Deleted (rogue):
  <NONE>
Expired (deleted):
  <NONE>
2013-03-09 11:20:12,915 [DEBUG]  @injection.py:61 - Returning callable provider for feature CERT_SORTER: <class 'subscription_manager.cert_sorter.CertSorter'>
2013-03-09 11:20:12,917 [DEBUG]  @injection.py:64 - Returning instance for feature IDENTITY
2013-03-09 11:20:12,946 [DEBUG]  @certdirectory.py:187 - Installed product IDs: ['100000000000006', '1000000000000023', '1144', '100000000000011', '99000', '27060', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000060', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000069', '100000000000020', '88888', '917571', '801', '37070']
2013-03-09 11:20:12,947 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-03-09 11:20:12,948 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-03-09 11:20:12,949 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-03-09 11:20:12,949 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-compat-rhel64.pem'
2013-03-09 11:20:12,950 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-03-09 11:20:12,950 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-03-09 11:20:12,951 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/a49525ec-0990-4822-9b5f-68c1a51108d0/compliance
2013-03-09 11:20:13,042 [DEBUG]  @connection.py:434 - Response status: 410
2013-03-09 11:20:13,046 [DEBUG]  @injection.py:61 - Returning callable provider for feature PRODUCT_DATE_RANGE_CALCULATOR: <class 'subscription_manager.validity.ValidProductDateRangeCalculator'>
2013-03-09 11:20:13,047 [DEBUG]  @injection.py:64 - Returning instance for feature IDENTITY
2013-03-09 11:20:13,049 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-03-09 11:20:13,050 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-7candlepin.pem'
2013-03-09 11:20:13,052 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2013-03-09 11:20:13,053 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-compat-rhel64.pem'
2013-03-09 11:20:13,055 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-03-09 11:20:13,056 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-03-09 11:20:13,057 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/a49525ec-0990-4822-9b5f-68c1a51108d0
2013-03-09 11:20:13,147 [DEBUG]  @connection.py:434 - Response status: 410
2013-03-09 11:20:13,150 [ERROR]  @managercli.py:144 - exception caught in subscription-manager
2013-03-09 11:20:13,151 [ERROR]  @managercli.py:145 - Consumer a49525ec-0990-4822-9b5f-68c1a51108d0 has been deleted
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 90, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 81, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2173, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 160, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 473, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1114, in _do_command
    subscribed = show_autosubscribe_output(self.cp)
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 197, in show_autosubscribe_output
    EntitlementDirectory(), uep)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 89, in getInstalledProductStatus
    calculator = FEATURES.require(PRODUCT_DATE_RANGE_CALCULATOR, uep)
  File "/usr/share/rhsm/subscription_manager/injection.py", line 62, in require
    return provider(*args, **kwargs)
  File "/usr/share/rhsm/subscription_manager/validity.py", line 30, in __init__
    self.consumer_data = self.uep.getConsumer(self.identity.uuid)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 731, in getConsumer
    return self.conn.request_get(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 481, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 443, in _request
    self.validateResponse(result)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 465, in validateResponse
    parsed['displayMessage'], parsed['deletedId'])
GoneException: Consumer a49525ec-0990-4822-9b5f-68c1a51108d0 has been deleted

Comment 2 Devan Goodwin 2013-03-18 12:14:29 UTC
Fixed in subscription-manager.git master: 2949e35f4faf28535fb9ad8a225e2421b5691daa

Will appear in 1.8.5.

Comment 3 Shwetha Kallesh 2013-04-05 07:28:57 UTC
Verified!!

Verifying version:

[root@localhost ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.1-1
subscription-manager: 1.8.5-1.el7
python-rhsm: 1.8.8-1.el7

[root@localhost ~]# subscription-manager register --username=testuser1 --password=password --org=admin --force --autosubscribe
The system with UUID 6fda536b-057f-4a32-a8df-8c5c20b8388c has been unregistered
The system has been registered with id: bad26c38-7043-4f8b-888e-a461880c3b48 
Installed Product Current Status:
Product Name: Awesome OS for S390 Bits
Status:       Not Subscribed

Product Name: Stackable with Awesome OS for x86_64 Bits
Status:       Subscribed

Product Name: Awesome OS Developer Basic
Status:       Not Subscribed

Product Name: Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits
Status:       Subscribed


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