Bug 1660224 - subscription-manager set commands failing to set any attributes (syspurpose)
Summary: subscription-manager set commands failing to set any attributes (syspurpose)
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
unspecified
high
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
: 1661107 (view as bug list)
Depends On:
Blocks: 1638153 1641577 1652753 1656802
TreeView+ depends on / blocked
 
Reported: 2018-12-17 21:04 UTC by Craig Donnelly
Modified: 2019-06-14 00:45 UTC (History)
7 users (show)

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


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1998 None closed Use the result from SyncResult objects for showing syspurpose 2020-02-04 13:15:27 UTC
Github candlepin subscription-manager pull 1999 None closed 1660224: Allow setting and unsetting of addons and service level 2020-02-04 13:15:27 UTC

Description Craig Donnelly 2018-12-17 21:04:18 UTC
Description of problem:
When registered to a subscription-management service, subscription-manager cannot set syspurpose attributes.

[root@unused ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Invalid

[root@unused ~]# subscription-manager role --set "RHEL Server"
role set to "RHEL Server".
[root@unused ~]# ss
{}
System purpose successfully sent to subscription management server.
{}[root@unused ~]# subscription-manager service-level --set Premium
service_level_agreement set to "Premium".
[root@unused ~]# ss
{}
System purpose successfully sent to subscription management server.
{}[root@unused ~]# subscription-manager usage --set Dev
usage set to "Dev".
[root@unused ~]# ss
{}
System purpose successfully sent to subscription management server.
{}
======================================================
[root@unused ~]# unreg
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
System has been unregistered.
[root@unused ~]# subscription-manager role --set "RHEL Server"
role set to "RHEL Server".
[root@unused ~]# ss
{
  "role": "RHEL Server"
}
Unable to send system purpose to subscription management server
{
  "role": "RHEL Server"
}{
  "role": "RHEL Server"
}


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


How reproducible: 100%


Steps to Reproduce:
1. subscription-manager register --auto-attach
2. subscription-manager role --set "RHEL Server"
3. syspurpose show

Actual results:
{}

Expected results:
{
  "role": "RHEL Server"
}


Additional info:

Comment 2 Rehana 2018-12-18 15:39:09 UTC
Still fails against stage candlepin : 
=======================================

[root@dell-r730-002-guest15 test]# subscription-manager role --set=fll
role set to "fll".
[root@dell-r730-002-guest15 test]# syspurpose show
{}
System purpose successfully sent to subscription management server.
[root@dell-r730-002-guest15 test]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.11-1
subscription management rules: 5.30
subscription-manager: 1.23.8-11.el8

also , observed that with this new build a lot of conflicting messages were appear , as opposed to the recent testing observation the build earlier to this https://bugzilla.redhat.com/show_bug.cgi?id=1633264#c8


[root@dell-r730-002-guest15 test]# subscription-manager addons --add bar
Due to a conflicting change made at the server the addons has not been set.
If you'd like to overwrite the server side change please run: subscription-manager addons --add bar

Same is observed even after removing the cache file .
------------------------------------------------

[root@dell-r730-002-guest15 test]# rm -rf /var/lib/rhsm/cache/syspurpose.json
[root@dell-r730-002-guest15 test]# subscription-manager addons --add bar
Due to a conflicting change made at the server the addons has not been set.
If you'd like to overwrite the server side change please run: subscription-manager addons --add bar
[root@dell-r730-002-guest15 test]# subscription-manager addons --add bar
Due to a conflicting change made at the server the addons has not been set.
If you'd like to overwrite the server side change please run: subscription-manager addons --add bar
[root@dell-r730-002-guest15 test]#

Comment 10 Shwetha Kallesh 2019-01-07 06:54:53 UTC
Preliminary verification comment:

[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=foo
role set to "foo".
[root@kvm-02-guest13 ~]# subscription-manager addons --add bar
addons updated.
[root@kvm-02-guest13 ~]# syspurpose show
{
  "addons": [
    "bar"
  ],
  "role": "foo",
}
System purpose successfully sent to subscription management server.

Comment 12 Kevin Howell 2019-01-14 15:27:16 UTC
*** Bug 1661107 has been marked as a duplicate of this bug. ***

Comment 13 Rehana 2019-01-16 09:16:02 UTC
Verifying on :
================

# 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-14.el8

Scenario 1 : Register and set values using subscription-manger syspurpose commands 

# subscription-manager  register --username=stage_test**
rRegistering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: d69781c5-76b7-456f-a2ae-7280c33d0e39
The registered system name is: kvm-02-guest09.rhts.eng.bos.redhat.com

# subscription-manager role --set="RHEL Server" ; subscription-manager usage --set="QA" ; subscription-manager service-level --set="Premium" ; subscription-manager addons --add="High Availability"
role set to "RHEL Server".
usage set to "QA".
service_level_agreement set to "Premium".
addons updated.

# syspurpose show
{
  "addons": [
    "High Availability"
  ],
  "role": "RHEL Server",
  "service_level_agreement": "Premium",
  "usage": "QA"
}
System purpose successfully sent to subscription management server.

^^ PASS , all values have been successfully set 

Scenario 2 : Register and set values using syspurpose commands 
==============================================================
# subscription-manager  register --username=stage_test********
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: fdd21b52-7a15-47b0-b60f-61cdfccc7986
The registered system name is: kvm-02-guest09.rhts.eng.bos.redhat.com

Before setting  

# syspurpose show
{}
System purpose successfully sent to subscription management server.

# syspurpose set-role "RHEL Server"; syspurpose set-usage "Production" ; syspurpose set-sla "Basic" ; syspurpose add-addons "addon1" "addon2" ; syspurpose show
role set to RHEL Server
System purpose successfully sent to subscription management server.
usage set to Production
System purpose successfully sent to subscription management server.
service_level_agreement set to Basic
System purpose successfully sent to subscription management server.
Added addon1 to addons.
Added addon2 to addons.
System purpose successfully sent to subscription management server.
{
  "addons": [
    "addon2",
    "addon1"
  ],
  "role": "RHEL Server",
  "service_level_agreement": "Basic",
  "usage": "Production"
}
System purpose successfully sent to subscription management server.

^^PASS , all values have been successfully set 

Also verified that user can successfully set the value on unregistered system as well using subscription-manager /syspurpose tool

Moving to verified!!


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