Bug 1426357
Summary: | RegisterWithActivationKeys method on dbus from com.redhat.RHSM1.Register interface fails with no keys exist for this org | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Sean Toner <stoner> |
Component: | subscription-manager | Assignee: | Alex Wood <awood> |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 7.3 | CC: | awood, csnyder, jstavel, redakkan, skallesh |
Target Milestone: | rc | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | subscription-manager-1.19.9-1 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 19:21:47 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
Sean Toner
2017-02-23 18:32:00 UTC
Note for developer: The in_signature of Register and RegisterWithActivationKey are not parallel. The last parameter for one is "a{ss}" and for the other "a{sv}". Make them uniform. Oops, step 3 in steps to reproduce should be: 3. Create an ActivationKey with the following command: curl -X POST -H "Content-Type:application/json" -k -u {user}:{password} \ "https://subscription.rhn.stage.redhat.com:443/subscription/owners/{org}/activation_keys" \ -d '{"name":"{name-of-activation-key}","autoAttach":"false"}' Also, here's the output of my step 7: ==================================== curl -X GET -H "Content-Type:application/json" -k -u stoner-dbus-test:________ \ "https://subscription.rhn.stage.redhat.com:443/subscription/owners/10879679/activation_keys" \ -d '{"name":"stoner-dbus-test-activation-key","autoAttach":"false"}' | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 487 0 424 100 63 145 21 0:00:03 0:00:02 0:00:01 145 [ { "autoAttach": false, "contentOverrides": [], "created": "2017-02-22T18:39:54.000+0000", "description": null, "id": "8a99f9895a5ee06d015a671f62055e9f", "name": "stoner-dbus-test-activation-key", "owner": { "displayName": "10879679", "href": "/owners/10879679", "id": "8a99f9845a248553015a3e3689020e68", "key": "10879679" }, "pools": [], "productIds": [], "releaseVer": { "releaseVer": null }, "serviceLevel": null, "updated": "2017-02-22T18:39:54.000+0000" } ] Pending fix: https://github.com/candlepin/subscription-manager/pull/1566 Note to QA: ***The DBus signature for RegisterWithActivationKeys has changed***. It is now "sasa{sv}". The new command to use will look like: busctl --address=unix:abstract=$SOCKET call com.redhat.RHSM1 /com/redhat/RHSM1/Register com.redhat.RHSM1.Register RegisterWithActivationKeys 'sasa{sv}' admin 1 default_key 0 I have tested this by trying against both a standalone candlepin test server, and the stage candlepin to make sure it is reading the rhsm.conf file properly. It successfully registered to both candlepins (after restarting the rhsm and rhsmcertd.service to pick up the changes in the rhsm.conf file). Shown below is a registration to the stage candlepin (the output is in the attached file actkey-register-stage.txt): [root@stoner-rh74-test ~]# subscription-manager status +-------------------------------------------+ System Status Details +-------------------------------------------+ Overall Status: Unknown [root@stoner-rh74-test ~]# curl -X GET -H "Content-Type:application/json" -k -u 'stoner-actkey-test:redHAT2017' "https://subscription.rhn.stage.redhat.com:443/subscription/owners/10947014/activation_keys" | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 404 0 404 0 0 307 0 --:--:-- 0:00:01 --:--:-- 307 [ { "autoAttach": false, "contentOverrides": [], "created": "2017-05-10T13:58:40.000+0000", "description": null, "id": "8a99f9865bd5837d015bf2a793995793", "name": "actkey_test", "owner": { "displayName": "10947014", "href": "/owners/10947014", "id": "8a99f9815bd51840015bf2a162637a59", "key": "10947014" }, "pools": [], "productIds": [], "releaseVer": { "releaseVer": null }, "serviceLevel": null, "updated": "2017-05-10T13:58:40.000+0000" } ] rhsm.conf values for stage ========================== [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep subscription.rhn.stage hostname=subscription.rhn.stage.redhat.com [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep "port=443" port=443 [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep "/subscription" prefix=/subscription And these are the results when running against a standalone candlepin (with the results of the dbus call in actkey-register-standalone.txt): [root@stoner-rh74-test ~]# subscription-manager status +-------------------------------------------+ System Status Details +-------------------------------------------+ Overall Status: Unknown [root@stoner-rh74-test ~]# curl -X GET -H "Content-Type:application/json" -k -u testuser1:password "https://stoner-candle.usersys.redhat.com:8443/candlepin/activation_keys/ff8080815a112bc2015beeb689835dd7" { "id" : "ff8080815a112bc2015beeb689835dd7", "name" : "actkey_test", "description" : null, "owner" : { "id" : "ff808081584c9e0401584c9fb91b0004", "key" : "admin", "displayName" : "Admin Owner", "href" : "/owners/admin" }, "pools" : [ ], "products" : [ ], "contentOverrides" : [ ], "serviceLevel" : null, "autoAttach" : false, "created" : "2017-05-09T19:36:31+0000", "updated" : "2017-05-09T19:36:31+0000", "releaseVer" : { "releaseVer" : null } } with the following values in rhsm.conf ====================================== [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep stoner hostname=stoner-candle.usersys.redhat.com [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep port=8443 port=8443 [root@stoner-rh74-test ~]# cat /etc/rhsm/rhsm.conf | grep prefix=/candlepin prefix=/candlepin Created attachment 1277625 [details]
registering with activation key against stage
Created attachment 1277626 [details]
registering with activation key against standalone candlepin
Created attachment 1277628 [details]
logs from journalctl while making dbus registration with key
I have written functional test for this usecase. It was passed. 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. https://access.redhat.com/errata/RHBA-2017:2083 |