Bug 798788 - results from subscription-manager facts --update after a server-side consumer was deleted
results from subscription-manager facts --update after a server-side consumer...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.10
Unspecified Unspecified
unspecified Severity medium
: beta
: 5.10
Assigned To: William Poteat
Entitlement Bugs
:
: 894633 (view as bug list)
Depends On:
Blocks: rhsm-rhel510 rhsm-2013
  Show dependency treegraph
 
Reported: 2012-02-29 16:01 EST by John Sefler
Modified: 2013-09-30 18:32 EDT (History)
4 users (show)

See Also:
Fixed In Version: 1.8.2
Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-30 18:32:38 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 John Sefler 2012-02-29 16:01:17 EST
Description of problem:
After a consumer has been deleted server-side, a client call to subscription-manager facts --update throws "Error updating system data, see /var/log/rhsm/rhsm.log for more details." when it would be nicer to throw "Consumer 3f443a2a-3a6f-4181-ab78-1f5e6c1311d0 has been deleted".

Version-Release number of selected component (if applicable):
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.8-1.git.8.cc12bc5.el6.x86_64
[root@jsefler-r63-server ~]# rpm -q python-rhsm
python-rhsm-0.99.4-1.git.2.a313a70.el6.noarch


How reproducible:


Steps to Reproduce:
[root@jsefler-r63-server ~]# subscription-manager register --username testuser1
--password password --org admin --force
The system has been registered with id: 8511a2a6-c2ec-4612-8186-af932a3b97cf 
[root@jsefler-r63-server ~]# grep hostname /etc/rhsm/rhsm.conf
# Server hostname:
hostname=jsefler-f14-candlepin.usersys.redhat.com
proxy_hostname=
[root@jsefler-r63-server ~]# curl -k -u testuser1:password --request DELETE
https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/consumers/8511a2a6-c2ec-4612-8186-af932a3b97cf
[root@jsefler-r63-server ~]# subscription-manager identity
Consumer 8511a2a6-c2ec-4612-8186-af932a3b97cf has been deleted
[root@jsefler-r63-server ~]# subscription-manager facts --update
Error updating system data, see /var/log/rhsm/rhsm.log for more details.

^^^ expected that last call to subscription-manager facts --update to again
report "Consumer 8511a2a6-c2ec-4612-8186-af932a3b97cf has been deleted"


Notice in the rhsm.log below that this exception appears catchable.


[root@jsefler-r63-server ~]# tail -f /var/log/rhsm/rhsm.log
2012-02-29 15:51:43,725 [INFO]  @connection.py:384 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2012-02-29 15:51:43,726 [INFO]  @connection.py:395 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-02-29 15:51:43,729 [INFO]  @cache.py:154 - Checking current system info against cache: /var/lib/rhsm/facts/facts.json
2012-02-29 15:51:44,073 [DEBUG]  @cert_sorter.py:106 - Sorting product and entitlement cert status for: 2012-02-29 20:51:44.073776+00:00
2012-02-29 15:51:44,114 [DEBUG]  @cert_sorter.py:159 - Installed product IDs: ['100000000000060', '1000000000000023', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '27060', '69', '917571', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000006', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '37090', '37070']
2012-02-29 15:51:44,118 [DEBUG]  @cert_sorter.py:175 - Checking certificate: 7782102222851179131
2012-02-29 15:51:44,125 [DEBUG]  @cert_sorter.py:200 -   stack ID: 1
2012-02-29 15:51:44,125 [DEBUG]  @cert_sorter.py:252 - Checking stack validity: 1
2012-02-29 15:51:44,126 [DEBUG]  @cert_sorter.py:265 -   system has 2 sockets, 1 covered by entitlements
2012-02-29 15:51:44,126 [DEBUG]  @cert_sorter.py:212 -   stack is invalid
2012-02-29 15:51:44,128 [DEBUG]  @cert_sorter.py:112 - valid entitled products: []
2012-02-29 15:51:44,128 [DEBUG]  @cert_sorter.py:113 - expired entitled products: []
2012-02-29 15:51:44,129 [DEBUG]  @cert_sorter.py:114 - partially entitled products: ['1000000000000023']
2012-02-29 15:51:44,129 [DEBUG]  @cert_sorter.py:115 - unentitled products: ['100000000000006', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '27060', '69', '37090', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000060', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '917571', '37070']
2012-02-29 15:51:44,129 [DEBUG]  @cert_sorter.py:116 - future products: []
2012-02-29 15:51:44,129 [DEBUG]  @cert_sorter.py:117 - partial stacks: ['1']
2012-02-29 15:51:44,129 [DEBUG]  @cert_sorter.py:118 - valid stacks: []
2012-02-29 15:51:44,131 [INFO]  @cache.py:156 - System data has changed, updating server.
2012-02-29 15:51:44,262 [DEBUG]  @cert_sorter.py:106 - Sorting product and entitlement cert status for: 2012-02-29 20:51:44.262003+00:00
2012-02-29 15:51:44,311 [DEBUG]  @cert_sorter.py:159 - Installed product IDs: ['100000000000060', '1000000000000023', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '27060', '69', '917571', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000006', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '37090', '37070']
2012-02-29 15:51:44,316 [DEBUG]  @cert_sorter.py:175 - Checking certificate: 7782102222851179131
2012-02-29 15:51:44,318 [DEBUG]  @cert_sorter.py:200 -   stack ID: 1
2012-02-29 15:51:44,318 [DEBUG]  @cert_sorter.py:252 - Checking stack validity: 1
2012-02-29 15:51:44,319 [DEBUG]  @cert_sorter.py:265 -   system has 2 sockets, 1 covered by entitlements
2012-02-29 15:51:44,319 [DEBUG]  @cert_sorter.py:212 -   stack is invalid
2012-02-29 15:51:44,322 [DEBUG]  @cert_sorter.py:112 - valid entitled products: []
2012-02-29 15:51:44,322 [DEBUG]  @cert_sorter.py:113 - expired entitled products: []
2012-02-29 15:51:44,322 [DEBUG]  @cert_sorter.py:114 - partially entitled products: ['1000000000000023']
2012-02-29 15:51:44,322 [DEBUG]  @cert_sorter.py:115 - unentitled products: ['100000000000006', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '27060', '69', '37090', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000060', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '917571', '37070']
2012-02-29 15:51:44,323 [DEBUG]  @cert_sorter.py:116 - future products: []
2012-02-29 15:51:44,323 [DEBUG]  @cert_sorter.py:117 - partial stacks: ['1']
2012-02-29 15:51:44,323 [DEBUG]  @cert_sorter.py:118 - valid stacks: []
2012-02-29 15:51:44,326 [DEBUG]  @connection.py:212 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-02-29 15:51:44,326 [DEBUG]  @connection.py:195 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2012-02-29 15:51:44,327 [DEBUG]  @connection.py:195 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-02-29 15:51:44,327 [DEBUG]  @connection.py:195 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-02-29 15:51:44,328 [DEBUG]  @connection.py:233 - Making request: PUT /candlepin/consumers/3f443a2a-3a6f-4181-ab78-1f5e6c1311d0
2012-02-29 15:51:44,456 [DEBUG]  @connection.py:247 - Response status: 410
2012-02-29 15:51:44,457 [ERROR]  @cache.py:164 - Error updating system data
2012-02-29 15:51:44,459 [ERROR]  @cache.py:165 - Consumer 3f443a2a-3a6f-4181-ab78-1f5e6c1311d0 has been deleted
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/cache.py", line 158, in update_check
    self._update_server(uep, consumer_uuid)
  File "/usr/share/rhsm/subscription_manager/facts.py", line 132, in _update_server
    uep.updateConsumer(consumer_uuid, facts=self.get_facts())
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 507, in updateConsumer
    ret = self.conn.request_put(method, params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 295, in request_put
    return self._request("PUT", method, params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 248, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 270, in validateResponse
    response['candlepin_version'])
GoneException: Consumer 3f443a2a-3a6f-4181-ab78-1f5e6c1311d0 has been deleted
2012-02-29 15:51:44,464 [ERROR]  @managercli.py:94 - exception caught in subscription-manager
2012-02-29 15:51:44,464 [ERROR]  @managercli.py:95 - Error updating system data, see /var/log/rhsm/rhsm.log for more details.
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 79, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 70, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1603, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 265, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1146, in _do_command
    facts.update_check(self.cp, consumer, force=True)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 166, in update_check
    raise Exception(_("Error updating system data, see /var/log/rhsm/rhsm.log "
Exception: Error updating system data, see /var/log/rhsm/rhsm.log for more details.
Comment 3 RHEL Product and Program Management 2012-07-10 04:48:09 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 4 RHEL Product and Program Management 2012-07-10 21:48:21 EDT
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 5 William Poteat 2013-01-11 14:20:28 EST
commit c42d7e392c12f13e00e974b8d6cfdfda9b156c72
Comment 6 William Poteat 2013-01-31 07:39:21 EST
*** Bug 894633 has been marked as a duplicate of this bug. ***
Comment 7 Bryan Kearney 2013-02-08 12:18:21 EST
Fixed in the 1.8.2 version of subscription-manager or python-rhsm
Comment 8 Shwetha Kallesh 2013-02-11 03:37:36 EST
[root@rhel7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.7.24-1
subscription-manager: 1.8.2-1.el7
python-rhsm: 1.8.2-1.el7


[root@rhel7 ~]# subscription-manager register --org=admin
Username: admin
Password: 
The system has been registered with id: 31c3e03c-a18c-42f7-8b10-5842a380aaf3 

curl -k -u admin:admin --request DELETE https://10.70.1.188:8443/candlepin/consumers/31c3e03c-a18c-42f7-8b10-5842a380aaf3

[root@rhel7 ~]# subscription-manager facts --update
Consumer 31c3e03c-a18c-42f7-8b10-5842a380aaf3 has been deleted

Marking verified!!
Comment 9 RHEL Product and Program Management 2013-04-09 16:50:29 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 11 errata-xmlrpc 2013-09-30 18:32:38 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.

http://rhn.redhat.com/errata/RHBA-2013-1332.html

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