Bug 1248955

Summary: Failed to register satellite-6.1 after updated candlepin to 2.0.6 [404 Resource Not Found]
Product: [Community] Candlepin Reporter: Eko <hsun>
Component: candlepinAssignee: Filip Nguyen <fnguyen>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 1.2CC: dgoodwin, fnguyen, gxing, sgao, shihliu
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-12 06:36:40 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:
Attachments:
Description Flags
cpdb --update
none
404 error register host to sam none

Description Eko 2015-07-31 08:13:09 UTC
Description of problem:
We want to verify the bug1240728, this issue need to install the latest candlepin-2.0.6, after updated candlepin to 2.0.6, register to satellite-6.1 failed, shows 404 Resource Not Found.

Version-Release number of selected component (if applicable):
candlepin-2.0.6-1.el7.noarch.rpm 
candlepin-selinux-2.0.6-1.el7.noarch.rpm
virt-who-0.14-2.el7.noarch
python-rhsm-1.15.3-1.el7.x86_64
subscription-manager-1.15.6-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. update candlepin to 2.0.6
The latest satellite-6.1 repository still provides candlepin0.9.49.3-1.el7.noarch.rpm, no candlepin-2.0.6 found. 
so we download candlepin-2.0.6 from https://brewweb.devel.redhat.com/buildinfo?buildID=448308 and update:
# rpm -Uvh candlepin-2.0.6-1.el7.noarch.rpm candlepin-selinux-2.0.6-1.el7.noarch.rpm

2. re-setup the rhsm config and register host again, it shows 404 Resource Not Found
# subscription-manager register --username=admin --password=admin
subscription-manager register  now has -1 pts of karma
There was an issue with the backend service candlepin: 404 Resource Not Found

3. check rhsm.log
# tail -f /var/log/rhsm/rhsm.log
Traceback (most recent call last):
   File "/usr/share/rhsm/subscription_manager/managercli.py", line 1069, in _do_command 
     content_tags=self.installed_mgr.tags)
   File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 833, in registerConsumer
     return self.conn.request_post(url, params)
   File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 612, in request_post
     return self._request("POST", method, params)
   File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 537, in _request
     self.validateResponse(result, request_type, handler)
   File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 579, in validateResponse
     raise RestlibException(response['status'], error_msg)
RestlibException: There was an issue with the backend service candlepin: 404 Resource Not Found


Actual results:
register failed due to candlepin: 404 Resource Not Found

Expected results:
after updated candlepin to 2.0.6, can be registered normally, virt-who can fetch the host/guests mapping info normally.

Additional info:

Comment 1 Devan Goodwin 2015-08-04 12:45:23 UTC
Candlepin updates almost always require a database upgrade. Normally this would happen during the overall Satellite upgrade.

However in your case you're going to need to trigger it manually. I cannot guarantee this is correct but I think you just need to run this after the rpm -Uvh:

/usr/share/candlepin/cpdb --update -u username -p password 

The database username and password I'm not sure about for a Sat install. Username is likely "candlepin", and password you should be able to see in the database config in /etc/candlepin/candlepin.conf. 

Be forewarned however that Candlepin 2.0 is unreleased and has not seen proper QE, the upgrade is significant and it's hard to say for sure if it's ready and will work without issue.

Comment 2 Eko 2015-08-11 08:57:23 UTC
Hi Devan,
After updated candlepin to 2.0.6 package,  I still failed to run:
# /usr/share/candlepin/cpdb  --update -u candlepin -p candlepin

More details, please refer to the attachment.

BTW, do we have some available yum repository integrated candlepin-2.0 with SAM/Satellite for internal testing?

Comment 3 Eko 2015-08-11 08:58:02 UTC
Created attachment 1061363 [details]
cpdb --update

Comment 4 Devan Goodwin 2015-08-11 11:17:46 UTC
Hi Eko, do you have liquibase 2.x installed?

This might require 3.x, which should be relatively widely available, epel, brew, etc.

There are no known builds of Satellite integrating candlepin 2.0 at this time as far as I am aware.

Comment 5 Eko 2015-08-12 09:09:19 UTC
Hi Devan, thanks for your feedback, I updated liquibase to 3.1.0-5 from brew's package, cpdb can update the database normally. 

but still can't register the host to the san server due to 
"Server error attempting a POST to /sam/api/consumers?owner=ACME_Corporation returned status 404"

More details, please refer to the register_error.log attachment.

Comment 6 Eko 2015-08-12 09:10:57 UTC
Created attachment 1061887 [details]
404 error register host to sam

Comment 7 Devan Goodwin 2015-08-12 11:09:13 UTC
We would probably need a foreman debug to see what the actual issue was on the server.

However this effort is doomed to fail, candlepin 2.0 needs proper integration into Satellite when the team has time, there will be Satellite changes required for it to function properly. Tom McKay was looking at this a bit, not sure where it stands yet but it should be happening for Sat 6.2.

Comment 8 Filip Nguyen 2015-10-01 17:22:56 UTC
Eko, are you still committed to resolve this? If so I will help you but I need actual logs from the CP server. 

If Devans answer in Comment 7 persuaded you that this is not an issue for now I will close this as NOT A BUG

Comment 9 Eko 2015-10-12 01:38:02 UTC
Hi, Filip Nguyen, now we are waiting for the candlepin 2.x integrated with Sat 6.2 ,  we don't update the candlepin to 2.x by manual for testing, so I think you can close it as Not A Bug.