Bug 1371420

Summary: Failed to refresh subscription-manager for stage candlepin, it will show "Server error attempting a PUT .... returned status 404"
Product: Red Hat Enterprise Linux 7 Reporter: Eko <hsun>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: crog, qianzhan, redakkan, sgao, shihliu, skallesh, yuefliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-30 17:49:55 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 Eko 2016-08-30 08:04:04 UTC
Description of problem:
register a physical host to stage candlepin normally, but if run "subscription-manager refresh", it will show "RemoteServerException: Server error attempting a PUT to /subscription/consumers/...... "

Version-Release number of selected component (if applicable):
subscription-manager-1.17.10-1.el7.x86_64
python-rhsm-1.17.6-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. configure the host for stage candlepin
# vi /etc/rhsm/rhsm.conf
hostname = subscription.rhsm.stage.redhat.com
baseurl= https://cdn.stage.redhat.com

2. register the host to stage candlepin
# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: virt-who-perf
Password: 
The system has been registered with ID: 176a4ab1-d454-499f-b398-5321fbcbe9d0


3. run "subscription-manager refresh"  => [Failed]
# subscription-manager refresh
Remote server error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information.


4. check rhsm.log
2016-08-30 04:02:20,078 [DEBUG] subscription-manager:1831:MainThread @ga_loader.py:89 - ga_loader GaImporterGtk3
2016-08-30 04:02:20,081 [DEBUG] subscription-manager:1831:MainThread @plugins.py:569 - loaded plugin modules: []
2016-08-30 04:02:20,081 [DEBUG] subscription-manager:1831:MainThread @plugins.py:570 - loaded plugins: {}
2016-08-30 04:02:20,081 [DEBUG] subscription-manager:1831:MainThread @identity.py:131 - Loading consumer info from identity certificates.
2016-08-30 04:02:20,111 [INFO] subscription-manager:1831:MainThread @managercli.py:384 - Client Versions: {'python-rhsm': '1.17.6-1.el7', 'subscription-manager': '1.17.10-1.el7'}
2016-08-30 04:02:20,112 [INFO] subscription-manager:1831:MainThread @connection.py:830 - Connection built: host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-08-30 04:02:20,112 [INFO] subscription-manager:1831:MainThread @connection.py:830 - Connection built: host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=none
2016-08-30 04:02:20,112 [INFO] subscription-manager:1831:MainThread @managercli.py:359 - Consumer Identity name=hp-z220-10.qe.lab.eng.nay.redhat.com uuid=176a4ab1-d454-499f-b398-5321fbcbe9d0
2016-08-30 04:02:20,113 [DEBUG] subscription-manager:1831:MainThread @connection.py:525 - Loaded CA certificates from /etc/rhsm/ca/: redhat-uep.pem
2016-08-30 04:02:20,113 [DEBUG] subscription-manager:1831:MainThread @connection.py:573 - Making request: PUT /subscription/consumers/176a4ab1-d454-499f-b398-5321fbcbe9d0/certificates?lazy_regen=true

2016-08-30 04:02:21,038 [DEBUG] subscription-manager:1831:MainThread @connection.py:602 - Response: status=404
2016-08-30 04:02:21,039 [ERROR] subscription-manager:1831:MainThread @managercli.py:174 - Unable to perform refresh due to the following exception: Server error attempting a PUT to /subscription/consumers/176a4ab1-d454-499f-b398-5321fbcbe9d0/certificates?lazy_regen=true returned status 404
2016-08-30 04:02:21,039 [ERROR] subscription-manager:1831:MainThread @managercli.py:175 - Server error attempting a PUT to /subscription/consumers/176a4ab1-d454-499f-b398-5321fbcbe9d0/certificates?lazy_regen=true returned status 404
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/subscription_manager/managercli.py", line 649, in _do_command
    self.cp.regenEntitlementCertificates(identity.uuid, True)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1353, in regenEntitlementCertificates
    return self.conn.request_put(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 703, in request_put
    return self._request("PUT", method, params)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 611, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 667, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a PUT to /subscription/consumers/176a4ab1-d454-499f-b398-5321fbcbe9d0/certificates?lazy_regen=true returned status 404




Actual results:
return 404 status when running "subscription-manager refresh"

Expected results:
subscription-manager refresh normally.

Additional info:

Comment 2 Chris "Ceiu" Rog 2016-08-30 17:49:55 UTC

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