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 1796088 - [RFE]: subscription-manager refresh needs a light version
Summary: [RFE]: subscription-manager refresh needs a light version
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.9
Hardware: x86_64
OS: All
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1794826 1796188
TreeView+ depends on / blocked
 
Reported: 2020-01-29 15:25 UTC by William Poteat
Modified: 2023-09-07 21:37 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Draft of documentation text: The default behavior of "subscription-manager refresh" command was modified and a new option "--force" was added. By default, this command no longer regenerates new entitlement certificates on subscription management service before downloading them. Now, it only downloads new copies of the existing entitlement certificates from subscription management service. If the old behavior is required (complete regeneration of entitlement certificates), then you must also pass the new "--force" option.
Clone Of: 1794826
Environment:
Last Closed: 2020-09-29 19:22:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2215 0 None closed 1794826: Added option --force for command refresh; ENT-2033 2020-10-27 16:58:11 UTC
Red Hat Product Errata RHBA-2020:3866 0 None None None 2020-09-29 19:23:17 UTC

Description William Poteat 2020-01-29 15:25:24 UTC
+++ This bug was initially created as a clone of Bug #1794826 +++

Description of problem:
The cost of subscription-manager refresh is taxing. From the client, the client will dirty the certificates and pull all-new, fresh information. An alternative to this being the default should be just pulling information and not forcing a default to dirty the current certificates. The current default could still be implemented if needed with a 'subscription-manager refresh --force'.


Version-Release number of selected component (if applicable):
subscription-manager-1.26.9-1.el8

How reproducible:
n/a

Steps to Reproduce:
1.
2.
3.

Actual results:
10.12.213.118 - - [24/Jan/2020:14:18:54 -0500] "PUT /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates?lazy_regen=true HTTP/1.1" 200 - "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:54 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates/serials HTTP/1.1" 200 32 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates?serials=7166878632496595261 HTTP/1.1" 200 8201 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/status HTTP/1.1" 200 377 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/ HTTP/1.1" 200 2125 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/content_overrides HTTP/1.1" 200 2 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=rhsmd)"


Expected results:
# subscription-manager refresh:
10.12.213.118 - - [24/Jan/2020:14:18:54 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates/serials HTTP/1.1" 200 32 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates?serials=7166878632496595261 HTTP/1.1" 200 8201 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/status HTTP/1.1" 200 377 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/ HTTP/1.1" 200 2125 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/content_overrides HTTP/1.1" 200 2 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"


# subscription-manager refresh --force:
10.12.213.118 - - [24/Jan/2020:14:18:54 -0500] "PUT /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates?lazy_regen=true HTTP/1.1" 200 - "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:54 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates/serials HTTP/1.1" 200 32 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/certificates?serials=7166878632496595261 HTTP/1.1" 200 8201 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/status HTTP/1.1" 200 377 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/ HTTP/1.1" 200 2125 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/content_overrides HTTP/1.1" 200 2 "-" "RHSM/1.0 (cmd=subscription-manager)"
10.12.213.118 - - [24/Jan/2020:14:18:55 -0500] "GET /rhsm/consumers/d8850955-3ba1-402b-a01b-e6bfe85bc164/compliance HTTP/1.1" 200 5920 "-" "RHSM/1.0 (cmd=subscription-manager)"

Additional info:
I'm not sure why there are 5 compliance calls being made at the end (4 from subman, 1 from rhsmd) being made back to back even when the first call returns with a http code 200. I excluded those from the expected output above as this could be included in the RFE.

Comment 5 Shwetha Kallesh 2020-04-15 09:38:49 UTC
Verification :

[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.9.21-1
subscription management rules: 5.37
subscription-manager: 1.24.32


Help message should display new force option: 

[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager refresh -h
Usage: subscription-manager refresh [OPTIONS]

Pull the latest subscription data from the server

Options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --noproxy=NO_PROXY    host suffixes that should bypass HTTP proxy
  --force               force certificate regeneration
^^ the new --force option


[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com --username ****** --password ******** --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: acdf2dc2-ec68-4289-b9be-b4543e095b87
The registered system name is: hpe-dl380pgen8-02-vm-4.hpe2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Academic Site Subscription with Smart Management, Premium (Server, Desktop, Workstation, POWER, HPC, per FTE)
Provides:            Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images
                     RHEL for SAP for Power, little endian - Extended Update Support
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Container Images Beta
                     RHEL for SAP HANA for Power, little endian - Extended Update Support
                     Red Hat Software Collections (for RHEL Server for IBM Power)
                     Red Hat Software Collections Beta (for RHEL Server for IBM Power)
                     Red Hat Software Collections (for RHEL Server for IBM Power LE)
                     Red Hat Enterprise Linux for Power, little endian
                     Red Hat Software Collections Beta (for RHEL Server for IBM Power LE)
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     dotNET on RHEL Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Oracle Java (for RHEL Client)
                     Oracle Java (for RHEL Compute Node)
                     Oracle Java (for RHEL Workstation)
                     Red Hat Software Collections (for RHEL Server)
                     RHEL for SAP - Extended Update Support
                     Red Hat Software Collections (for RHEL Workstation)
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Workstation)
                     Red Hat Ansible Engine
                     Red Hat Enterprise Linux Desktop
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux for Power, little endian - Extended Update Support
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat CodeReady Linux Builder for Power, little endian
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
                     RHEL for SAP Applications for Power BE
                     Red Hat Enterprise Linux Resilient Storage for IBM Power LE - Extended Update Support
                     Red Hat Developer Toolset (for RHEL Workstation)
                     RHEL for SAP Applications for Power BE EUS
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian
                     RHEL for SAP Applications for Power LE EUS
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Workstation
                     Red Hat Enterprise Linux for Power, big endian
                     Red Hat Enterprise Linux for Power, big endian - Extended Update Support
                     Red Hat Enterprise Linux for Scientific Computing
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux High Availability (for IBM Power LE) - Extended Update Support
                     dotNET on RHEL (for RHEL Workstation)
                     dotNET on RHEL Beta (for RHEL Workstation)
                     Red Hat Enterprise Linux for Power 9
                     Red Hat Enterprise Linux for SAP Applications for x86_64
                     dotNET on RHEL (for RHEL Compute Node)
                     dotNET on RHEL Beta (for RHEL Compute Node)
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat CodeReady Linux Builder for Power, little endian - Extended Update Support
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
SKU:                 RH2501844          }
Contract:            12032883           } -----> Note the SKU and contract number, they should remain same after refresh with --force
Account:             6319586
Serial:              789552165554790931                                                              -------------------> Note the serial number 
Pool ID:             8a99f9ae6e15eba0016e180f5f07017c        ----------> Note the pool Id , it should remain unchanged too
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              10/29/2019
Ends:                10/28/2020
Entitlement Type:    Virtual

[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager refresh --force
1 local certificate has been deleted.     -------------------> Observe the message "1 local certificate has been deleted" , which should be displayed with force option as it will regenerate the entitlement 
All local data refreshed
[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Academic Site Subscription with Smart Management, Premium (Server, Desktop, Workstation, POWER, HPC, per FTE)
Provides:            Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images
                     RHEL for SAP for Power, little endian - Extended Update Support
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Container Images Beta
                     RHEL for SAP HANA for Power, little endian - Extended Update Support
                     Red Hat Software Collections (for RHEL Server for IBM Power)
                     Red Hat Software Collections Beta (for RHEL Server for IBM Power)
                     Red Hat Software Collections (for RHEL Server for IBM Power LE)
SKU:                 RH2501844 }
Contract:            12032883  } -----------------------> Observe the SKU and contract number remain same after refresh --force
Account:             6319586
Serial:              2634088288942311511               --------------------> Observe the serial number has changed after refresh with --force option , entitlement with new serial number has been generated
Pool ID:             8a99f9ae6e15eba0016e180f5f07017c  ---------------------> Observe the pool id remains unchanged
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              10/29/2019
Ends:                10/28/2020
Entitlement Type:    Virtual



Now try to execute refresh without --force , entitlement cert should not be regenerated


[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Academic Site Subscription with Smart Management, Premium (Server, Desktop, Workstation, POWER, HPC, per FTE)
Provides:            Red Hat Enterprise Linux Workstation
                     Red Hat Enterprise Linux for Power, big endian
                     Red Hat Enterprise Linux for Power, big endian - Extended Update Support
                     Red Hat Enterprise Linux for Scientific Computing
                     Red Hat Beta                     
SKU:                 RH2501844
Contract:            12032883
Account:             6319586
Serial:              2634088288942311511                                --------------------------> Note the serial number
Pool ID:             8a99f9ae6e15eba0016e180f5f07017c
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              10/29/2019
Ends:                10/28/2020
Entitlement Type:    Virtual

[root@hpe-dl380pgen8-02-vm-4 ~]# vi /etc/rhsm/rhsm.conf 
[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager refresh
All local data refreshed
^^ The message "1 local certificate has been deleted" is not displayed anymore without --force option

[root@hpe-dl380pgen8-02-vm-4 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Academic Site Subscription with Smart Management, Premium (Server, Desktop, Workstation, POWER, HPC, per FTE)
Provides:            Red Hat Enterprise Linux Workstation
                     Red Hat Enterprise Linux for Power, big endian
                     Red Hat Enterprise Linux for Power, big endian - Extended Update Support
                     Red Hat Enterprise Linux for Scientific Computing
                     Red Hat Beta                     
SKU:                 RH2501844
Contract:            12032883
Account:             6319586
Serial:              2634088288942311511                                --------------------------> Observe that serial number is same 
Pool ID:             8a99f9ae6e15eba0016e180f5f07017c
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              10/29/2019
Ends:                10/28/2020
Entitlement Type:    Virtual

Comment 7 errata-xmlrpc 2020-09-29 19:22:47 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 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:3866


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