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 1842474 - Unable to set any of the syspurpose value neither using syspurpose tool nor with subscription-manager syspurpose modules
Summary: Unable to set any of the syspurpose value neither using syspurpose tool nor w...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 8.0
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-01 11:11 UTC by Shwetha Kallesh
Modified: 2020-11-04 01:40 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.27.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:39:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2275 0 None closed 1842474: Update local and cache file during sync(); ENT-2433 2021-01-30 12:07:46 UTC
Red Hat Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:39:33 UTC

Description Shwetha Kallesh 2020-06-01 11:11:24 UTC
Description of problem:
Unable to set any of the syspurpose value neither using syspurpose tool nor with subscription-manager syspurpose modules

Version-Release number of selected component (if applicable):
[root@kvm-06-guest02 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.1.11-1
subscription management rules: 5.40
subscription-manager: 1.27.5-1.git.0.f1fe06e.el8


How reproducible:


Steps to Reproduce:
[root@kvm-06-guest02 ~]# rm -f /etc/rhsm/syspurpose/syspurpose.json
[root@kvm-06-guest02 ~]# rm -rf /var/lib/rhsm/cache/syspurpose_compliance_status.json
[root@kvm-06-guest02 ~]# rm -f /var/lib/rhsm/cache/syspurpose.json
[root@kvm-06-guest02 ~]# subscription-manager role --set fooRole
role set to "fooRole".
[root@kvm-06-guest02 ~]# syspurpose show
{}
[root@kvm-06-guest02 ~]# syspurpose set-role fooRole
role set to "fooRole".
[root@kvm-06-guest02 ~]# syspurpose show
{}
[root@kvm-06-guest02 ~]# ls /etc/rhsm/syspurpose/valid_fields.json 
/etc/rhsm/syspurpose/valid_fields.json
[root@kvm-06-guest02 ~]# cat /etc/rhsm/syspurpose/valid_fields.json 
{
    "role": [
      "Red Hat Enterprise Linux Server",
      "Red Hat Enterprise Linux Workstation",
      "Red Hat Enterprise Linux Compute Node"
    ],
    "service_level_agreement": [
      "Premium",
      "Standard",
      "Self-Support"
    ],
    "usage": [
      "Production",
      "Development/Test",
      "Disaster Recovery"
    ]
}
[root@kvm-06-guest02 ~]# subscription-manager role --set "Red Hat Enterprise Linux Server"
role set to "Red Hat Enterprise Linux Server".
[root@kvm-06-guest02 ~]#  syspurpose show
{}

[root@kvm-06-guest02 ~]# syspurpose set-usage foo
usage set to "foo".
[root@kvm-06-guest02 ~]# syspurpose show
{}
[root@kvm-06-guest02 ~]# syspurpose set-sla foo
service_level_agreement set to "foo".
[root@kvm-06-guest02 ~]# syspurpose show
{}



Actual results:


Expected results:


Additional info:

Comment 3 Archana Pandey 2020-06-19 12:39:36 UTC
Reproducing issue on subscription manager version 1.27.5-1.el8

Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-04 test]# 
[root@ibm-x3650m4-01-vm-04 test]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.9.27-1
subscription management rules: 5.39
subscription-manager: 1.27.5-1.el8
[root@ibm-x3650m4-01-vm-04 test]# rm -f /etc/rhsm/syspurpose/syspurpose.json
[root@ibm-x3650m4-01-vm-04 test]# rm -rf /var/lib/rhsm/cache/syspurpose_compliance_status.json
[root@ibm-x3650m4-01-vm-04 test]# rm -f /var/lib/rhsm/cache/syspurpose.json
[root@ibm-x3650m4-01-vm-04 test]# subscription-manager role --set fooRole
role set to "fooRole".
[root@ibm-x3650m4-01-vm-04 test]# 
[root@ibm-x3650m4-01-vm-04 test]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-04 test]# syspurpose set-role fooRole
role set to "fooRole".
[root@ibm-x3650m4-01-vm-04 test]# 
[root@ibm-x3650m4-01-vm-04 test]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-04 test]# ls /etc/rhsm/syspurpose/valid_fields.json 
/etc/rhsm/syspurpose/valid_fields.json
[root@ibm-x3650m4-01-vm-04 test]#  cat /etc/rhsm/syspurpose/valid_fields.json
{
    "role": [
      "Red Hat Enterprise Linux Server",
      "Red Hat Enterprise Linux Workstation",
      "Red Hat Enterprise Linux Compute Node"
    ],
    "service_level_agreement": [
      "Premium",
      "Standard",
      "Self-Support"
    ],
    "usage": [
      "Production",
      "Development/Test",
      "Disaster Recovery"
    ]
}
[root@ibm-x3650m4-01-vm-04 test]# 
[root@ibm-x3650m4-01-vm-04 test]# subscription-manager role --set "Red Hat Enterprise Linux Server"
role set to "Red Hat Enterprise Linux Server".
[root@ibm-x3650m4-01-vm-04 test]# 
[root@ibm-x3650m4-01-vm-04 test]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-04 test]# syspurpose set-usage foo
usage set to "foo".
[root@ibm-x3650m4-01-vm-04 test]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-04 test]# syspurpose set-sla foo
service_level_agreement set to "foo".
[root@ibm-x3650m4-01-vm-04 test]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-04 test]# 


Actual results:
syspurpose show : {}    <<<<-----syspurpose values couldn't be set

Expected results:
syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "foo",
  "usage": "foo"
}


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

verifying issue on subscription manager version 1.27.6-1.el8

Beaker Test information:
                         HOSTNAME=ibm-x3650m4-01-vm-04.ibm2.lab.eng.bos.redhat.com
                            JOBID=4365064
                         RECIPEID=8452777
                    RESULT_SERVER=
                           DISTRO=RHEL-8.3.0-20200619.n.0
                     ARCHITECTURE=x86_64

verifying the bug fix changelog :
[root@archana-test test]# rpm -q subscription-manager --changelog | grep 1842474
- 1842474: Update local and cache file during sync(); ENT-2433

set of commands/output for issue verification: 
[root@ibm-x3650m4-01-vm-04 /]# 
[root@ibm-x3650m4-01-vm-04 /]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.9.27-1
subscription management rules: 5.39
subscription-manager: 1.27.6-1.el8
[root@ibm-x3650m4-01-vm-04 /]# rm -f /etc/rhsm/syspurpose/syspurpose.json
[root@ibm-x3650m4-01-vm-04 /]# rm -rf /var/lib/rhsm/cache/syspurpose_compliance_status.json
[root@ibm-x3650m4-01-vm-04 /]# rm -f /var/lib/rhsm/cache/syspurpose.json
[root@ibm-x3650m4-01-vm-04 /]# subscription-manager role --set fooRole
role set to "fooRole".
[root@ibm-x3650m4-01-vm-04 /]# syspurpose show

{
  "role": "fooRole"
}
[root@ibm-x3650m4-01-vm-04 /]# {}
-bash: {}: command not found
[root@ibm-x3650m4-01-vm-04 /]# ls /etc/rhsm/syspurpose/valid_fields.json 
/etc/rhsm/syspurpose/valid_fields.json
[root@ibm-x3650m4-01-vm-04 /]# cat /etc/rhsm/syspurpose/valid_fields.json
{
    "role": [
      "Red Hat Enterprise Linux Server",
      "Red Hat Enterprise Linux Workstation",
      "Red Hat Enterprise Linux Compute Node"
    ],
    "service_level_agreement": [
      "Premium",
      "Standard",
      "Self-Support"
    ],
    "usage": [
      "Production",
      "Development/Test",
      "Disaster Recovery"
    ]
}
[root@ibm-x3650m4-01-vm-04 /]# subscription-manager role --set "Red Hat Enterprise Linux Server"
role set to "Red Hat Enterprise Linux Server".
[root@ibm-x3650m4-01-vm-04 /]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server"
}
[root@ibm-x3650m4-01-vm-04 /]# syspurpose set-usage foo
usage set to "foo".
[root@ibm-x3650m4-01-vm-04 /]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "usage": "foo"
}
[root@ibm-x3650m4-01-vm-04 /]# syspurpose set-sla foo
service_level_agreement set to "foo".
[root@ibm-x3650m4-01-vm-04 /]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "foo",
  "usage": "foo"
}
[root@ibm-x3650m4-01-vm-04 /]# 


Actual results:
syspurpose values set successfully
[root@ibm-x3650m4-01-vm-04 /]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "foo",
  "usage": "foo"
}

Comment 6 errata-xmlrpc 2020-11-04 01:39:09 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 (subscription-manager bug fix and enhancement update), 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-2020:4460


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