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 1656802 - subscription-manager: I cannot unset role even I follow the sudgestion to run the command twicely
Summary: subscription-manager: I cannot unset role even I follow the sudgestion to run...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 1660224
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-06 11:18 UTC by Jan Stavel
Modified: 2019-06-14 02:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 02:06:33 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Stavel 2018-12-06 11:18:25 UTC
Description of problem:

I cannot unset a role property.
The application asks me to repeat the command.
Once I repeat it the application asks me to do so again.


Version-Release number of selected component (if applicable):

root@ibm-p9z-15-lp9 ~]# subscription-manager config | grep rhsm
   hostname = subscription.rhsm.stage.redhat.com
[rhsm]
   ca_cert_dir = [/etc/rhsm/ca/]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem


[root@ibm-p9z-15-lp9 ~]# rpm -qa | egrep "subscription|rhsm|cockpit"
dnf-plugin-subscription-manager-1.23.8-4.el8.ppc64le
subscription-manager-1.23.8-4.el8.ppc64le
subscription-manager-rhsm-certificates-1.23.8-4.el8.ppc64le
librhsm-0.0.3-2.el8.ppc64le
python3-subscription-manager-rhsm-1.23.8-4.el8.ppc64le


How reproducible:


   [root@ibm-p9z-15-lp9 ~]# subscription-manager role 
   
   You are attempting to use a locale that is not installed.
   Current Role: RHEL Server

   [root@ibm-p9z-15-lp9 ~]# subscription-manager role --unset
   
   You are attempting to use a locale that is not installed.
   Due to a conflicting change made at the server the role has not been set.
   If you'd like to overwrite the server side change please run: subscription-manager role --unset

   [root@ibm-p9z-15-lp9 ~]# subscription-manager role --unset
   
   You are attempting to use a locale that is not installed.
   Due to a conflicting change made at the server the role has not been set.
   If you'd like to overwrite the server side change please run: subscription-manager role --unset


Actual results:

The application tells me to repeat the previous command - again and again.

Expected results:

Once I repeat the command a role should be cleaned.

Additional info:

Comment 1 Jan Stavel 2018-12-10 10:36:38 UTC
I am trying to simulate this issue.
I'll let you all know once I simulate this issue.

Comment 3 Craig Donnelly 2018-12-11 16:48:07 UTC
Tested this against subscription-manager-1.23.8-6.el8:

[root@unused ~]# subscription-manager config | grep hostname
   hostname = subscription.rhsm.stage.redhat.com
[root@unused ~]# reg
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 0dba7f6d-3567-49fe-bca7-f905817e9180
The registered system name is: unused
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@unused ~]# subscription-manager role --set "RHEL Server"
Due to a conflicting change made at the server the role has not been set.
If you'd like to overwrite the server side change please run: subscription-manager role --set RHEL Server
[root@unused ~]# subscription-manager role --set "RHEL Server"
role set to "RHEL Server".

[root@unused ~]# syspurpose show
{
  "service_level_agreement": "",
  "usage": "",
  "role": "RHEL Server",
  "addons": []
}
System purpose successfully sent to subscription management server.
[root@unused ~]# ./ident.sh 
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
x-candlepin-request-uuid: 2b61cb5a-c0dc-40dd-abe6-d42640a4cab3
X-Version: 2.3.11-1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 11 Dec 2018 16:47:37 GMT

{"serviceLevel":"","role":"RHEL Server","usage":"","addOns":[]}[root@unused ~]# 
[root@unused ~]# subscription-manager role --unset
role unset.

==================

Can be unset successfully now.

Comment 4 Jan Stavel 2018-12-11 16:49:21 UTC
Thanks Crag for the help.

Comment 5 Jan Stavel 2018-12-11 16:50:14 UTC
I have already automated this scenario.

Comment 7 Craig Donnelly 2018-12-17 21:08:17 UTC
QA of this is BLOCKED on BZ 1660224

Comment 8 Shwetha Kallesh 2019-01-07 06:19:48 UTC
Verification:
[root@kvm-02-guest13 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.12-1
subscription management rules: 5.30
subscription-manager: 1.23.8-12.el8


[root@kvm-02-guest13 ~]# subscription-manager role --set "RHEL Server"

role set to "RHEL Server".
[root@kvm-02-guest13 ~]# 
[root@kvm-02-guest13 ~]# subscription-manager role 
Current Role: RHEL Server
[root@kvm-02-guest13 ~]# syspurpose show
{
  "role": "RHEL Server",
  "service_level_agreement": "Premium"
}
System purpose successfully sent to subscription management server.
[root@kvm-02-guest13 ~]# subscription-manager role --unset
role unset.
[root@kvm-02-guest13 ~]# syspurpose show
{
  "service_level_agreement": "Premium"
}
System purpose successfully sent to subscription management server.
[root@kvm-02-guest13 ~]# subscription-manager role 
Role not set.

[root@kvm-02-guest13 ~]# subscription-manager service-level --unset 
service_level_agreement unset.
[root@kvm-02-guest13 ~]# syspurpose show
{}
System purpose successfully sent to subscription management server.

[root@kvm-02-guest13 ~]# subscription-manager usage --set "QA"
usage set to "QA".
[root@kvm-02-guest13 ~]# syspurpose show
{
  "usage": "QA"
}
System purpose successfully sent to subscription management server.
[root@kvm-02-guest13 ~]# subscription-manager usage --unset
usage unset.
[root@kvm-02-guest13 ~]# syspurpose show
{}
System purpose successfully sent to subscription management server.


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