RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 817671 - [RFE] Add Support for Activation Keys in GUI
Summary: [RFE] Add Support for Activation Keys in GUI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 6.4
Assignee: John Sefler
QA Contact: Entitlement Bugs
URL:
Whiteboard:
: 871016 (view as bug list)
Depends On:
Blocks: 771481 875220
TreeView+ depends on / blocked
 
Reported: 2012-04-30 20:10 UTC by Matt Reid
Modified: 2013-02-21 08:54 UTC (History)
7 users (show)

Fixed In Version: subscription-manager-1.1.6-1
Doc Type: Release Note
Doc Text:
Activation Keys Support in the GUI The Subscription Manager graphical user interface now allows you to register a system using an activation key. Activation keys allow users to preconfigure subscriptions for a system before it is registered.
Clone Of:
: 875220 (view as bug list)
Environment:
Last Closed: 2013-02-21 08:54:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
registering with an activation key from the subscription-manager-gui and firstboot (339.38 KB, image/png)
2013-01-03 15:13 UTC, John Sefler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0350 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-02-20 20:53:35 UTC

Description Matt Reid 2012-04-30 20:10:48 UTC
Description of problem:
Currently, we only support Activation Keys using the CLI, as we introduce complexity through orgs and environments, there are more ways the user could go wrong. Activation Keys could see more usage as that should eliminate the burden being on the user to make all the correct choices. Instead, they can enter a preconfigured key and be all set.

I think we can add support in for Activation keys in both firstboot and the GUI, by adding it as an option to the registration flow. If they selected the Activation Key option, input a valid key, and clicked forward, then we could show a confirmation screen what the activation key would subscribe them to (would we need to include where as well? which env/org?). Would we be able to do any sort of type checking on the key as they type it or would we have to do verification after they click forward and maybe need them to go back and tweak it if it doesn't work?

This shows the basic flow described above:
https://engineering.redhat.com/trac/subscription-manager/attachment/wiki/GUIRedesign/Activation%20Key.png

Additional Info:
Would we need to add in support to use an activation key on an already registered machine? My understanding is they currently only come into play as part of the registration process and only apply to cert based management, not classic.

Comment 3 Alex Wood 2012-10-22 19:43:38 UTC
commit 6a138541765106e1d9d4839d24da230fbc3810c0
Author:     Alex Wood <awood>
AuthorDate: Fri Oct 5 17:52:31 2012 -0400
Commit:     Alex Wood <awood>
CommitDate: Wed Oct 17 13:36:34 2012 -0400

    817671: Add support for Activation Keys in the GUI.

Please note that the activation key path does not auto-subscribe the user.  It merely registers them.

Comment 4 Matt Reid 2012-10-25 17:59:37 UTC
The current implementation doesn't pay any attention to subscriptions that are configured as part of the given activation key. I think the CLI functions how this should, where if you register with an activation key, after registration, you will have subscriptions attached (as defined by that activation key). Registering with the same activation key through the GUI, they'll be registered, but there won't be any subscriptions attached, even if the activation key includes a subscription. 

We shouldn't do an auto-subscribe as part of this, but if there are any subscriptions that are part of the activation key being used, we should attach those.

Let me know if there are any questions.

Comment 5 Matt Reid 2012-10-25 18:41:01 UTC
Looks like you can get subscription manager into a weird state if you register without an activation key, unregister, and then register with an activation key (all without closing subscription manager gui).

When I did this, I used the same orgs and envs as the activation key was going to use later, but not sure if that's important or not.

If you do all that, you'll get blocked from registering with the activation key through the GUI (CLI still works), but GUI errors out no matter what you put in as information, saying you gave invalid credentials. Closing and reopening subscription manager seems to get it sorted out.


    2012-10-25 13:55:14,241 [DEBUG] @connection.py:165 - ContectConnection
    2012-10-25 13:55:16,706 [INFO] @connection.py:519 - Using no auth
    2012-10-25 13:55:16,706 [INFO] @connection.py:522 - Connection Built: host: sam-12.usersys.redhat.com, port: 443, handler: /sam/api
    2012-10-25 13:55:16,706 [INFO] @registergui.py:322 - Registering to owner: ACME_Corporation environment: 3
    2012-10-25 13:55:17,629 [DEBUG] @connection.py:355 - Making request: POST /sam/api/environments/3/consumers
    2012-10-25 13:55:17,702 [DEBUG] @connection.py:368 - Response status: 401
    2012-10-25 13:55:17,702 [ERROR] @utils.py:56 - Invalid credentials
    Traceback (most recent call last):
    File "/usr/share/rhsm/subscription_manager/gui/registergui.py", line 308, in _on_registration_finished_cb
    raise error
    RestlibException: Invalid credentials
    2012-10-25 13:55:17,720 [DEBUG] @managergui.py:304 - Registration changed, updating main window.

Comment 6 Matt Reid 2012-10-25 19:40:52 UTC
This probably isn't something that would happen very often, but its odd that it can happen.

If you register with an activation key through the GUI, and then auto-subscribe after, a few strange things happen. First, it complains about not having the subscriptions and service levels to complete autosubscription, yet it attaches a subscription and turns my system from red to green. If you close out that error dialog and then try to open the Preferences dialog to see if there's an SLA pref set, you get a network error and we can't show the dialog. You get a network error trying to open the Preferences dialog or trying to run sub-man release --list. Sub-man service-level --list works, and --show works for release and service-level. According to the output, there's no service level preference set.

See pastebin.test.redhat.com/112845 for rhsm.log info

I'm guessing it won't be possible (or at least it will be more difficult) to hit this once we get activation keys through the gui updated per comment 4, but maybe it's still worth looking into/preventing?

Comment 7 Alex Wood 2012-10-25 20:13:26 UTC
Pasting in log referenced in comment 6.

2012-10-25 15:34:29,051 [DEBUG]  @connection.py:213 - Loading CA certificate: '/etc/pki/entitlement/6470527825162651471.pem'
2012-10-25 15:34:29,111 [ERROR]  @utils.py:56 - (-2, 'Name or service not known')
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 366, in _preferences_item_clicked
    self.preferences_dialog.show()
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 155, in show
    self.load_current_settings()
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 79, in load_current_settings
    self.load_releases(consumer_json)
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 113, in load_releases
    available_releases = self.release_backend.get_releases()
  File "/usr/share/rhsm/subscription_manager/release.py", line 98, in get_releases
    data = self.content_connection.get_versions(listing_path)
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 231, in get_versions
    results = self._request("GET", handler, body="")
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 199, in _request
    conn.request("GET", handler, body="", headers={"Host": "%s:%s" % (self.host, self.ssl_port), "Content-Length": "0"})
  File "/usr/lib64/python2.4/httplib.py", line 810, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.4/httplib.py", line 833, in _send_request
    self.endheaders()
  File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders
    self._send_output()
  File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.4/httplib.py", line 652, in send
    self.connect()
  File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 49, in connect
    for (family, _, _, _, _) in \
gaierror: (-2, 'Name or service not known')

Comment 8 Matt Reid 2012-10-25 20:30:41 UTC
Comment 7 is the second error encountered (the network error), it might depend on the first piece that occurs when you auto-subscribe after using a key. Both are in the pastebin url from comment 6, but may as well add it directly here for convenience.

This is the part that shows when you autosubscribe after registering with the activation key through the gui.

2012-10-25 15:34:22,675 [INFO]  @cache.py:160 - Checking current system info against cache: /var/lib/rhsm/facts/facts.json
2012-10-25 15:34:22,676 [INFO]  @cache.py:162 - System data has changed, updating server.
2012-10-25 15:34:22,676 [DEBUG]  @facts.py:148 - Updating facts on server
2012-10-25 15:34:22,676 [DEBUG]  @connection.py:355 - Making request: PUT /sam/api/consumers/ebaa2365-4e77-4e83-9375-58ecdd22b504
2012-10-25 15:34:23,205 [DEBUG]  @connection.py:368 - Response status: 200
2012-10-25 15:34:23,228 [DEBUG]  @connection.py:355 - Making request: GET /sam/api/
2012-10-25 15:34:23,276 [DEBUG]  @connection.py:368 - Response status: 200
2012-10-25 15:34:23,276 [DEBUG]  @connection.py:539 - Server supports the following resources:
2012-10-25 15:34:23,276 [DEBUG]  @connection.py:540 - {'organizations': '/api/organizations/', 'users': '/api/users/', 'roles': '/api/roles/', 'providers': '/api/providers/', 'environments': '/api/environments/', 'entitlements': '/api/entitlements/', 'systems': '/api/systems/', 'activation_keys': '/api/activation_keys/', 'consumers': '/api/consumers/'}
2012-10-25 15:34:23,276 [INFO]  @cache.py:215 - Server does not support packages, skipping profile upload.
2012-10-25 15:34:23,278 [INFO]  @cache.py:160 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2012-10-25 15:34:23,278 [INFO]  @cache.py:175 - No changes.
2012-10-25 15:34:23,278 [DEBUG]  @connection.py:355 - Making request: GET /sam/api/consumers/ebaa2365-4e77-4e83-9375-58ecdd22b504/entitlements/dry-run?service_level=Self-support
2012-10-25 15:34:23,402 [DEBUG]  @connection.py:368 - Response status: 200
2012-10-25 15:34:23,402 [DEBUG]  @autobind.py:50 - Unentitled products: set(['69'])
2012-10-25 15:34:23,402 [DEBUG]  @autobind.py:58 - Autobind would give access to: set([])
2012-10-25 15:34:23,402 [DEBUG]  @autobind.py:63 - Service level does not cover required products: Self-support
2012-10-25 15:34:23,403 [DEBUG]  @connection.py:355 - Making request: GET /sam/api/consumers/ebaa2365-4e77-4e83-9375-58ecdd22b504/entitlements/dry-run?service_level=Standard
2012-10-25 15:34:23,645 [DEBUG]  @connection.py:368 - Response status: 200
2012-10-25 15:34:23,645 [DEBUG]  @autobind.py:50 - Unentitled products: set(['69'])
2012-10-25 15:34:23,645 [DEBUG]  @autobind.py:58 - Autobind would give access to: set([])
2012-10-25 15:34:23,645 [DEBUG]  @autobind.py:63 - Service level does not cover required products: Standard
2012-10-25 15:34:23,646 [INFO]  @registergui.py:513 - No suitable service levels found.
2012-10-25 15:34:23,646 [ERROR]  @utils.py:56 - None
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 48, in ?
    from dbus.bus import REQUEST_NAME_REPLY_PRIMARY_OWNER
ImportError: No module named bus

Comment 9 Bryan Kearney 2012-10-26 17:40:00 UTC
I bet you have to switch the connection at some point. We should ensure the subscirptions come down.

Comment 10 Alex Wood 2012-10-30 17:50:38 UTC
The issue described in comment 5 is fixed with commit 94c4519086103c658b3d1a69c97759e443391c4d

Comment 11 Alex Wood 2012-11-02 13:45:40 UTC
The issue described in comment 4 is fixed:

commit a3506937104f5b7e807dc9a154e0479bae9c8947
Author:     Alex Wood <awood>
AuthorDate: Thu Nov 1 14:01:51 2012 -0400
Commit:     Alex Wood <awood>
CommitDate: Thu Nov 1 14:02:43 2012 -0400

    Attach subscriptions after registration with an activation key.

Available in subscription-manager-1.1.6-1+

Comment 12 William Poteat 2012-11-02 20:17:03 UTC
*** Bug 871016 has been marked as a duplicate of this bug. ***

Comment 13 Adrian Likins 2012-11-09 21:31:04 UTC
I split out comments 6-8 into a new bug at https://bugzilla.redhat.com/show_bug.cgi?id=875220

comments up through 5 seem fixed now, so moving to modified

Comment 15 John Sefler 2013-01-03 15:13:26 UTC
Created attachment 672107 [details]
registering with an activation key from the subscription-manager-gui and firstboot

[root@jsefler-6 ~]# rpm -q subscription-manager-gui subscription-manager-firstboot
subscription-manager-gui-1.1.18-1.el6.x86_64
subscription-manager-firstboot-1.1.18-1.el6.x86_64


Registering with an activation key from both firstboot and subscription-manager-gui have been implemented.  This is enough to verify this RFE bugzilla.  Problems encoutered with the testing of this new feature should be opened under seperate individual bugzillas.

Moving this bugzilla to VERIFIED.

Comment 17 errata-xmlrpc 2013-02-21 08:54:45 UTC
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-0350.html


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