Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1019227 - auto-attach control does not work from client in CLI
auto-attach control does not work from client in CLI
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Subscription Management (Show other bugs)
6.0.3
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: Unused
Assigned To: Christine Fouant
jcallaha
http://projects.theforeman.org/issues...
: Reopened, Triaged
: 1103774 (view as bug list)
Depends On:
Blocks: sam20-tracker rhsm-rhel66 1405922 1460939
  Show dependency treegraph
 
Reported: 2013-10-15 06:33 EDT by qianzhan
Modified: 2017-06-13 04:14 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1405922 1460939 (view as bug list)
Environment:
Last Closed: 2015-08-12 01:07:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
'disable auto-attach from SAM web UI.png' (252.73 KB, image/png)
2013-10-15 06:34 EDT, qianzhan
no flags Details
'disable auto-attach in CLI and the GUI does not work.png' (154.60 KB, image/png)
2013-10-15 06:35 EDT, qianzhan
no flags Details
"enable auto-attach in satellite.png" (172.90 KB, image/png)
2015-02-28 04:47 EST, qianzhan
no flags Details
"enable auto-attach in subscripiton-manager-gui.png" (289.77 KB, image/png)
2015-02-28 04:48 EST, qianzhan
no flags Details
The auto-attach preference is still checked after disabling the it in CLI.png (263.67 KB, image/png)
2015-02-28 04:49 EST, qianzhan
no flags Details
enable auto-attach in satellite 2.png (158.72 KB, image/png)
2015-03-10 23:37 EDT, qianzhan
no flags Details
enable auto-attach in subscripiton-manager-gui 2.png (143.22 KB, image/png)
2015-03-10 23:38 EDT, qianzhan
no flags Details
The auto-attach preference is unchecked after disabling the it in CLI.png (142.65 KB, image/png)
2015-03-10 23:39 EDT, qianzhan
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 6012 None None None 2016-04-22 11:56 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description qianzhan 2013-10-15 06:33:59 EDT
Description of problem:
auto-attach control does not work from client in CLI

Version-Release number of selected component (if applicable):
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-cli-1.4.3-11.el6sat.noarch
katello-cli-common-1.4.3-11.el6sat.noarch
katello-common-1.4.3.19-1.el6sam_splice.noarch
katello-configure-1.4.4-5.el6sam.noarch
katello-glue-candlepin-1.4.3.19-1.el6sam_splice.noarch
katello-glue-elasticsearch-1.4.3.19-1.el6sam_splice.noarch
katello-headpin-1.4.3.19-1.el6sam_splice.noarch
katello-headpin-all-1.4.3.19-1.el6sam_splice.noarch
katello-selinux-1.4.4-2.el6sat.noarch
candlepin-0.8.26-1.el6sam.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
candlepin-selinux-0.8.26-1.el6sam.noarch
candlepin-tomcat6-0.8.26-1.el6sam.noarch
thumbslug-0.0.34-1.el6sam.noarch
thumbslug-selinux-0.0.34-1.el6sam.noarch
subscription-manager: 1.9.9-1.el6

How reproducible:
always

Steps to Reproduce:
1. Register to SAM
[root@qianqian ~]# subscription-manager register
Username: admin
Password: 
The system has been registered with ID: 1f2b4183-4ece-42d0-9049-27c60a4e51bb 

2. Examine the 'Enable auto-attach preference' checkbox:
subscription-manager-gui ==> Systme ==> Preferences: the checkbox is checked by debault.

3. Log in the SAM web UI and disable the auto-attach, see attachment 'disable auto-attach from SAM web UI.png'

4. Examine the auto-attach control from SAM server:
(1)The 'Enable auto-attach preference' checkbox from subscription-manager-gui: the checkbox is unchecked.
(2)Show the current auto-attach preference in CLI
[root@qianqian ~]# subscription-manager auto-attach --show
Auto-attach preference: disabled

5. Enable auto-attach both from SAM web UI and subscription-manager-gui, disable auto-attach in CLI and examine the auto-attach control from client:
(1) Disable auto-attach in CLI:
[root@qianqian ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled

(2)The checkbox is checked when disable auto-attach in CLI, see attachment 'disable auto-attach in CLI and the GUI does not work.png'

(3)Show the current auto-attach preference in CLI
[root@qianqian ~]# subscription-manager auto-attach --show
Auto-attach preference: enabled

Actual results:
As step 5.

Expected results:
When control auto-attach from client, the CLI and GUI should both work.

Additional info:
I have examined that the issue does not exist on stage candlepin.
Comment 1 qianzhan 2013-10-15 06:34:44 EDT
Created attachment 812417 [details]
'disable auto-attach from SAM web UI.png'
Comment 2 qianzhan 2013-10-15 06:35:18 EDT
Created attachment 812418 [details]
'disable auto-attach in CLI and the GUI does not work.png'
Comment 4 Carter Kozak 2014-01-30 11:04:06 EST
This sounds like something isn't sending a request correctly.

I cannot reproduce any problems with the subscription-manager client.  I think modifying it with other tools while the gui is running (preferences window open) gets the gui into a stale state, but nothing will actually be wrong.

It sounds like you're leaving the preferences window open, and expecting it to update, which never happens.

There may be a sam bug, but I can't really tell what the problem is from the description.

Feel free to re-open if this is still reproducible and is a bug, not just a stale preferences dialog (not closed and re-opened).
Comment 5 gaoshang 2014-02-08 05:13:03 EST
This bug still exit in RHEL-7.0-20140207.0, so I reopened it, please see following details.

1, Register to SAM, and run "# subscription-manager auto-attach --disable"
2, Run "# subscription-manager-gui", the auto-attach check box in System Preference window still selected.

It should be a SAM bug, because when registered to Stage Candlepin, rerun above steps, the result is correct, please compare the logs

Run command "# subscription-manager auto-attach --disable" after registered to Stage Candlepin

    2014-02-08 04:02:24,610 [DEBUG] subscription-manager @plugins.py:519 - loaded plugin modules: []
    2014-02-08 04:02:24,610 [DEBUG] subscription-manager @plugins.py:520 - loaded plugins: {}
    2014-02-08 04:02:24,630 [DEBUG] subscription-manager @identity.py:130 - Loading consumer info from identity certificates.
    2014-02-08 04:02:24,635 [DEBUG] subscription-manager @profile.py:97 - Loading current RPM profile.
    2014-02-08 04:02:24,729 [INFO] subscription-manager @managercli.py:288 - Client Versions: {'python-rhsm': '1.10.12-1.el7', 'subscription-manager': '1.10.13-1.el7'}
    2014-02-08 04:02:24,730 [INFO] subscription-manager @connection.py:663 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
    2014-02-08 04:02:24,730 [INFO] subscription-manager @connection.py:674 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
    2014-02-08 04:02:24,730 [INFO] subscription-manager @connection.py:670 - Using no auth
    2014-02-08 04:02:24,730 [INFO] subscription-manager @connection.py:674 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
    2014-02-08 04:02:24,741 [DEBUG] subscription-manager @connection.py:418 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem
    2014-02-08 04:02:24,741 [DEBUG] subscription-manager @connection.py:450 - Making request: GET /subscription/
    2014-02-08 04:02:25,798 [DEBUG] subscription-manager @connection.py:473 - Response: status=200
    2014-02-08 04:02:25,799 [DEBUG] subscription-manager @connection.py:690 - Server supports the following resources:
    2014-02-08 04:02:25,799 [DEBUG] subscription-manager @connection.py:691 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'distributor_versions': '/distributor_versions', 'hypervisors': '/hypervisors', 'products': '/products', 'entitlements': '/entitlements', 'pools': '/pools'}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2014-02-08 04:02:25,800 [INFO] subscription-manager @managercli.py:299 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'Red Hat Subscription Management'}
    2014-02-08 04:02:25,801 [DEBUG] subscription-manager @connection.py:418 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem
    2014-02-08 04:02:25,802 [DEBUG] subscription-manager @connection.py:450 - Making request: PUT /subscription/consumers/599e263a-3aee-45f5-8e07-7004d935e5b9
    2014-02-08 04:02:27,355 [DEBUG] subscription-manager @connection.py:473 - Response: status=204


Run command "# subscription-manager auto-attach --disable" after registered to SAM
    2014-02-08 03:32:21,731 [DEBUG] subscription-manager @plugins.py:519 - loaded plugin modules: []
    2014-02-08 03:32:21,731 [DEBUG] subscription-manager @plugins.py:520 - loaded plugins: {}
    2014-02-08 03:32:21,751 [DEBUG] subscription-manager @identity.py:130 - Loading consumer info from identity certificates.
    2014-02-08 03:32:21,756 [DEBUG] subscription-manager @profile.py:97 - Loading current RPM profile.
    2014-02-08 03:32:21,846 [INFO] subscription-manager @managercli.py:288 - Client Versions: {'python-rhsm': '1.10.12-1.el7', 'subscription-manager': '1.10.13-1.el7'}
    2014-02-08 03:32:21,846 [INFO] subscription-manager @connection.py:663 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
    2014-02-08 03:32:21,846 [INFO] subscription-manager @connection.py:674 - Connection Built: host: samserv.redhat.com, port: 443, handler: /sam/api
    2014-02-08 03:32:21,847 [INFO] subscription-manager @connection.py:670 - Using no auth
    2014-02-08 03:32:21,847 [INFO] subscription-manager @connection.py:674 - Connection Built: host: samserv.redhat.com, port: 443, handler: /sam/api
    2014-02-08 03:32:21,858 [DEBUG] subscription-manager @connection.py:418 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem
    2014-02-08 03:32:21,858 [DEBUG] subscription-manager @connection.py:450 - Making request: GET /sam/api/
    2014-02-08 03:32:21,908 [DEBUG] subscription-manager @connection.py:473 - Response: status=200
    2014-02-08 03:32:21,909 [DEBUG] subscription-manager @connection.py:690 - Server supports the following resources:
    2014-02-08 03:32:21,909 [DEBUG] subscription-manager @connection.py:691 - {'status': '/api/status/', 'organizations': '/api/organizations/', 'roles': '/api/roles/', 'sync_plans': '/api/sync_plans/', 'users': '/api/users/', 'distributors': '/api/distributors/', 'providers': '/api/providers/', 'entitlements': '/api/entitlements/', 'content_views': '/api/content_views/', 'system_groups': '/api/system_groups/', 'products': '/api/products/', 'systems': '/api/systems/', 'activation_keys': '/api/activation_keys/', 'content_view_definitions': '/api/content_view_definitions/', 'consumers': '/api/consumers/'}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2014-02-08 03:32:21,911 [DEBUG] subscription-manager @connection.py:418 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem
    2014-02-08 03:32:21,911 [DEBUG] subscription-manager @connection.py:450 - Making request: GET /sam/api/status
    2014-02-08 03:32:21,940 [DEBUG] subscription-manager @connection.py:473 - Response: status=200
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2014-02-08 03:32:21,941 [INFO] subscription-manager @managercli.py:299 - Server Versions: {'candlepin': '1.4.3.23-1.el6sam_splice-Headpin', 'server-type': 'Red Hat Subscription Management'}
    2014-02-08 03:32:21,942 [DEBUG] subscription-manager @connection.py:418 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-local.pem
    2014-02-08 03:32:21,943 [DEBUG] subscription-manager @connection.py:450 - Making request: PUT /sam/api/consumers/d4e0044e-7c32-4fc0-bebc-c2a3f02e064e
    2014-02-08 03:32:22,481 [DEBUG] subscription-manager @connection.py:473 - Response: status=200
Comment 6 William Poteat 2014-07-08 11:37:08 EDT
The setting of this parameter works correctly when the client is run against Candlepin. It is only when SAM [1.3 or 1.4] is involved that the setting is ineffective. Pushing this to katello team for resolution.
Comment 7 RHEL Product and Program Management 2014-07-09 14:04:18 EDT
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
Comment 9 Christine Fouant 2014-07-10 16:14:51 EDT
Created redmine issue http://projects.theforeman.org/issues/6578 from this bug
Comment 10 Christine Fouant 2014-07-16 17:12:36 EDT

*** This bug has been marked as a duplicate of bug 1113879 ***
Comment 11 qianzhan 2014-07-16 23:21:38 EDT
I don't think this bug is duplicate of 1113879, because this bug aims at auto-attach function by CLI, while 1113879 by Web UI.
Comment 12 Christine Fouant 2014-07-17 14:16:42 EDT

*** This bug has been marked as a duplicate of bug 1103774 ***
Comment 13 qianzhan 2014-07-17 23:48:26 EDT
Bug 1103774 should be a duplicate of this bug, because this bug is filed earlier than 1103774 by more than 8 months.
Comment 14 qianzhan 2014-07-17 23:48:56 EDT
*** Bug 1103774 has been marked as a duplicate of this bug. ***
Comment 15 Bryan Kearney 2014-07-29 14:18:49 EDT
Connecting redmine issue http://projects.theforeman.org/issues/6012 from this bug
Comment 19 qianzhan 2015-02-28 04:46:59 EST
Verifying Version:
subscription-manager: 1.13.22-1.el7
python-rhsm: 1.13.10-1.el7

Verification:
1. Prepare Satellite-6.1.0-RHEL-7-20150225.0 and RHEL-7.1-20150219.1

2. Register the rhel to satellite:

[root@dhcp-128-77 ~]# rpm -ivh katello-ca-consumer-intel-s3e3432-01.rhts.eng.bos.redhat.com-1.0-1.noarch.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:katello-ca-consumer-intel-s3e3432################################# [100%]

[root@dhcp-128-77 ~]# subscription-manager register
Username: admin
Password: 
The system has been registered with ID: c8c33775-6698-4a8f-9b05-0dd9a25e2932 

3. Enable auto-attach in satellite web UI: see attachment "enable auto-attach in satellite.png"

4. Enable auto-attach in subscription-manager-gui of RHEL7.1: see attachment "enable auto-attach in subscripiton-manager-gui.png"

5. Disable auto-attach in CLI of RHEL7.1
[root@dhcp-128-77 ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled

6. Lanch subscription-manager-gui and open Preference window: The auto-attach preference is still checked, see attachment "The auto-attach preference is still checked after disabling the it in CLI.png"

7. Show the current auto-attach preference in CLI:
[root@dhcp-128-77 ~]# subscription-manager auto-attach --show
Auto-attach preference: enabled

As per step 6 and step 7, disabling auto-attach in subscription-manager CLI, can not control the auto-attach preference in subscription-manager-gui, can not control the auto-attach preference in subscription-manager CLI neither.

Moving the bug from ON_QA to ASSIGNED.
Comment 20 qianzhan 2015-02-28 04:47:46 EST
Created attachment 996407 [details]
"enable auto-attach in satellite.png"
Comment 21 qianzhan 2015-02-28 04:48:24 EST
Created attachment 996408 [details]
"enable auto-attach in subscripiton-manager-gui.png"
Comment 22 qianzhan 2015-02-28 04:49:02 EST
Created attachment 996409 [details]
The auto-attach preference is still checked after disabling the it in CLI.png
Comment 23 Christine Fouant 2015-03-10 18:40:48 EDT
I have tried this using a RHEL7.1 machine and the latest compose (Satellite-6.1.0-RHEL-7-20150310.0), and I have not been able to recreate this bug. I am able to enable and disable it from CLI, and in sub-man-gui those changes are reflected.
Comment 24 qianzhan 2015-03-10 23:36:41 EDT
Verifying Version:
subscription-manager: 1.13.22-1.el7
python-rhsm: 1.13.10-1.el7

Verification:
1. Prepare Satellite-6.1.0-RHEL-7-20150310.0 and RHEL-7.1-20150219.1

2. Register the rhel to satellite:

[root@dhcp-128-77 ~]# subscription-manager register
Username: admin
Password: 
The system has been registered with ID: 4913a150-640a-47f2-9439-7ffd5887cd36 
[root@dhcp-128-77 ~]# 

3. Enable auto-attach in satellite web UI: see attachment "enable auto-attach in satellite 2.png"

4. Enable auto-attach in subscription-manager-gui of RHEL7.1: see attachment "enable auto-attach in subscripiton-manager-gui 2.png"

5. Disable auto-attach in CLI of RHEL7.1

[root@dhcp-128-77 ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled

6. Lanch subscription-manager-gui and open Preference window: 

The auto-attach preference is unchecked, see attachment "The auto-attach preference is unchecked after disabling the it in CLI.png"

7. Show the current auto-attach preference in CLI:

[root@dhcp-128-77 ~]# subscription-manager auto-attach --show
Auto-attach preference: disabled

As per step 6 and step 7, Moving the bug from ON_QA to VERIFIED.
Comment 25 qianzhan 2015-03-10 23:37:47 EDT
Created attachment 1000259 [details]
enable auto-attach in satellite 2.png
Comment 26 qianzhan 2015-03-10 23:38:24 EDT
Created attachment 1000260 [details]
enable auto-attach in subscripiton-manager-gui 2.png
Comment 27 qianzhan 2015-03-10 23:39:30 EDT
Created attachment 1000261 [details]
The auto-attach preference is unchecked after disabling the it in CLI.png
Comment 28 Bryan Kearney 2015-08-11 09:26:37 EDT
This bug is slated to be released with Satellite 6.1.
Comment 29 errata-xmlrpc 2015-08-12 01:07:41 EDT
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/RHSA-2015:1592

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