Bug 818887

Summary: Unable to unregister a system via SAM GUI
Product: [Retired] Subscription Asset Manager Reporter: Ryoichiro Tsuruno <rtsuruno>
Component: candlepinAssignee: Jordan OMara <jomara>
Status: CLOSED WORKSFORME QA Contact: SAM QE List <sam-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: athomas, esammons, jomara, mcoggin, tomckay
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-29 13:41:48 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 Ryoichiro Tsuruno 2012-05-04 09:41:58 UTC
Description of problem: I have successfully registered a virtual system via SAM GUI once.  I deleted this system from Customer Portal > Subscription tab > Consumer.  Now I am unable to unregister the system via SAM GUI.  The error message is:

Consumer c9f66bfxxxxxxxxx has been deleted
Please see /var/log/rhsm/rhsm.log for details.

/var/log/rhsm/rhsm.log says:
2012-05-04 17:09:16,222 [INFO]  @connection.py:350 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2012-05-04 17:09:16,224 [DEBUG]  @connection.py:188 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-05-04 17:09:16,225 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-05-04 17:09:16,227 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-05-04 17:09:16,230 [DEBUG]  @connection.py:209 - Making request: GET /subscription/
2012-05-04 17:09:17,640 [DEBUG]  @connection.py:218 - Response status: 200
2012-05-04 17:09:17,643 [DEBUG]  @connection.py:379 - Server supports the following resources:
2012-05-04 17:09:17,644 [DEBUG]  @connection.py:380 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2012-05-04 17:09:17,645 [INFO]  @connection.py:362 - Connection Established: host: subscription.rhn.redhat.com, port: 443, handler: /subscription
2012-05-04 17:09:17,655 [DEBUG]  @connection.py:188 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-05-04 17:09:17,656 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-05-04 17:09:17,658 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-05-04 17:09:17,660 [DEBUG]  @connection.py:209 - Making request: GET /subscription/consumers/c9f66b2f-50c3-4bfc-9924-0d669242bfa5/owner
2012-05-04 17:09:19,233 [DEBUG]  @connection.py:218 - Response status: 410
2012-05-04 17:09:19,234 [ERROR]  @managercli.py:401 - Consumer c9f66b2f-50c3-4bfc-9924-0d669242bfa5 has been deleted
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 382, in _do_command
    owner = self.cp.getOwner(consumerid)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 481, in getOwner
    return self.conn.request_get(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 252, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 219, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 239, in validateResponse
    raise RestlibException(response['status'], error_msg)
RestlibException: Consumer c9f66b2f-50c3-4bfc-9924-0d669242bfa5 has been deleted
2012-05-04 17:09:19,240 [ERROR]  @managercli.py:402 - Error: Unable to generate a new identity for the system: Consumer c9f66b2f-50c3-4bfc-9924-0d669242bfa5 has been deleted

I have resolved the issue by running "subscription-manager clean" command in console.  However, this was not in the documentation.  "man subscription-manager" was the only way to access this information.

Version-Release number of selected component (if applicable):


How reproducible:
Every time you delete the system through Customer Portal.

Steps to Reproduce:
1. Register a system using SAM GUI
2. Delete this system through Customer Portal > Subscription > Consumers
3. Press "Unregister" button on SAM GUI
  
Actual results:
Cannot unregister the system.

Expected results:
Either "Unregister" button cleans the local information or document "subscription-manager clean" command in Installation document.

Additional info:

Comment 2 RHEL Program Management 2012-05-04 09:54:54 UTC
Thank you for your bug report. This issue was evaluated for inclusion
in the current release of Subscription Asset Manager (SAM). Unfortunately,
we are unable to address this request. Because we are in the final stages
of development in the current release, only significant, release-blocking
issues involving serious regressions and data corruption can be considered.

If you believe this issue meets the release blocking criteria as defined and
communicated to you by your Red Hat Support representative, please ask
your representative to file this issue as a blocker for the current release.
Otherwise, ask that it be evaluated for inclusion in the next release of SAM.

Comment 3 RHEL Program Management 2012-05-04 10:14:39 UTC
Thank you for your bug report. This issue was evaluated for inclusion
in the current release of Subscription Asset Manager (SAM). Unfortunately,
we are unable to address this request. Because we are in the final stages
of development in the current release, only significant, release-blocking
issues involving serious regressions and data corruption can be considered.

If you believe this issue meets the release blocking criteria as defined and
communicated to you by your Red Hat Support representative, please ask
your representative to file this issue as a blocker for the current release.
Otherwise, ask that it be evaluated for inclusion in the next release of SAM.

Comment 5 Ryoichiro Tsuruno 2012-05-08 02:59:25 UTC
Here is my rhsm.conf file.  I am registering against hosted SAM (if that's a correct term).  Another strange thing is that when I launch SAM GUI, it reports that the system is registered to hosted RHN even though I have it registered against hosted SAM.


[root@rhel6-1 ~]# cat /etc/rhsm/rhsm.conf
# Red Hat Subscription Manager Configuration File:

# Unified Entitlement Platform Configuration
[server]
# Server hostname:
hostname = subscription.rhn.redhat.com

# Server prefix:
prefix = /subscription

# Server port:
port = 443

# Set to 1 to disable certificate validation:
insecure = 0

# Set the depth of certs which should be checked
# when validating a certificate
ssl_verify_depth = 3

# Server CA certificate location:
ca_cert_dir = /etc/rhsm/ca/

# an http proxy server to use
proxy_hostname =

# port for http proxy server
proxy_port = 

# user name for authenticating to an http proxy, if needed
proxy_user =

# password for basic http proxy auth, if needed
proxy_password =

[rhsm]
# Content base URL:
baseurl= https://cdn.redhat.com

# Default CA cert to use when generating yum repo configs:
repo_ca_cert = %(ca_cert_dir)sredhat-uep.pem

# Where the certificates should be stored
productCertDir = /etc/pki/product
entitlementCertDir = /etc/pki/entitlement
consumerCertDir = /etc/pki/consumer

[rhsmcertd]
# Frequency of certificate refresh (in minutes):
certFrequency = 240
# Frequency of autoheal check (1440 min = 1 day):
healFrequency = 1440

Comment 6 Jordan OMara 2012-05-09 19:12:01 UTC
I wrote a github gist for connecting your local rhsm to SAM. Can you try these settings and try again? (substitute /headpin for your installation, presumably /sam)

https://gist.github.com/2645015

Comment 7 Tom McKay 2012-05-18 15:45:23 UTC
Is this still an issue? Is there any more help that is required?
Thanks!
Tom

Comment 8 Tom McKay 2012-05-29 13:41:48 UTC
Closing as working