Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2010137

Summary: Subscription manager sends redundant requests to the server in SCA mode
Product: Red Hat Enterprise Linux 7 Reporter: Hao Chang Yu <hyu>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.9CC: cdonnell, csnyder, fhirtz, jhnidek, jinjli, jreznik, jsefler, njajodia, pdwyer, rcain, redakkan, rjerrido, sbhamrah, xzhou
Target Milestone: rcKeywords: TestCannotAutomate, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2014052 2016301 (view as bug list) Environment:
Last Closed: 2021-11-23 17:15:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2014052, 2016301    

Description Hao Chang Yu 2021-10-04 01:14:51 UTC
Description of problem:
Subscription manager sends redundant requests to the server, especially in the SCA mode. This could cause unexpected burden to the server, especially for Satellite which is managing a lot of clients.

# Version
subscription-manager-rhsm-1.24.48-1.el7_9.x86_64
subscription-manager-rhsm-certificates-1.24.48-1.el7_9.x86_64
subscription-manager-1.24.48-1.el7_9.x86_64
katello-host-tools-fact-plugin-3.5.4-1.el7sat.noarch
katello-host-tools-3.5.4-1.el7sat.noarch

# Run "yum repolist" in SCA mode:
xx.xx.xx.xx - - [01/Oct/2021:17:07:39 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/certificates/serials HTTP/1.1" 200 122 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:39 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/certificates?serials=4626653215071048968 HTTP/1.1" 200 10159 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:39 +1000] "GET /rhsm/status HTTP/1.1" 200 426 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:39 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/accessible_content HTTP/1.1" 200 6606 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:39 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:40 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:40 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/accessible_content HTTP/1.1" 200 6606 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:40 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:40 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:40 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:41 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:41 +1000] "GET /rhsm/ HTTP/1.1" 200 2345 "-" "RHSM/1.0 (cmd=yum)"
##########################
Below are redundant requests caused by upload profiles because it is calling YumBase class which triggers the yum hook again.
Bug 1621275 fixed this by upadating redhat.repo in yum "prereposetup_hook"
##########################
xx.xx.xx.xx - - [01/Oct/2021:17:07:41 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/certificates/serials HTTP/1.1" 200 122 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:41 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/certificates?serials=4626653215071048968 HTTP/1.1" 200 10159 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:41 +1000] "GET /rhsm/status HTTP/1.1" 200 426 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/accessible_content HTTP/1.1" 200 6606 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/accessible_content HTTP/1.1" 200 6606 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:42 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:43 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/content_overrides HTTP/1.1" 200 9115 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:07:43 +1000] "GET /rhsm/consumers/82b2ddaa-70ae-4ca8-9576-d8f31750caba/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"

# VS

# Run "yum repolist" in Entitlement mode:
xx.xx.xx.xx - - [01/Oct/2021:17:49:21 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/certificates/serials HTTP/1.1" 200 122 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:21 +1000] "GET /rhsm/status HTTP/1.1" 200 426 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:21 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/content_overrides HTTP/1.1" 200 2 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:22 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"
##########################
Below are redundant requests caused by upload profiles because it is calling YumBase class which triggers the yum hook again.
Bug 1621275 fixed this by upadating redhat.repo in yum "prereposetup_hook"
##########################
xx.xx.xx.xx - - [01/Oct/2021:17:49:22 +1000] "GET /rhsm/ HTTP/1.1" 200 2345 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:22 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/certificates/serials HTTP/1.1" 200 122 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:22 +1000] "GET /rhsm/status HTTP/1.1" 200 426 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:23 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/content_overrides HTTP/1.1" 200 2 "-" "RHSM/1.0 (cmd=yum)"
xx.xx.xx.xx - - [01/Oct/2021:17:49:23 +1000] "GET /rhsm/consumers/f69328be-b631-44e4-b514-147ea797810b/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=yum)"


Steps to Reproduce:
1. Enable SCA mode in the Satellite
2. Register the client to the Satellite
3. Install katello-host-tools rpms
4. Run yum repolist command. 

Actual results:
Redundant /accessible_content, /content_overrides and /release

Expected results:
No redundant requests

Comment 3 Hao Chang Yu 2021-10-04 03:30:08 UTC
Make some improvements to prevent candlepin traffics. Not sure if we can backport this commit.

https://bugzilla.redhat.com/show_bug.cgi?id=1621275

commit c737200c2b1df1381786227e85c7465b1ae9fb2c
Author: Jiri Hnidek <jhnidek>
Date:   Tue Sep 3 14:07:22 2019 +0200

    1621275: YUM plugin - less API calls; ENT-923
    
    * BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1621275
    * Do not try to communicate with candlepin server, when "local
      yum commands are executed (e.g. yum --help, list, check,
      history, etc.).
    * Added another cache file with list of supported resources
      - utils.py method get_supported_resources()
      - It is used only by yum plugin now
      - Added some unit tests related to this
    * The presence of identity and entitlements certificates on
      the disk is checked in postconfig hook
    * Updating of redhat.repo is done in prereposetup_hook
    * Small refactoring of code

Comment 4 Hao Chang Yu 2021-10-04 03:35:05 UTC
This commit also have some improvements to avoid candlepin traffics.

commit 01f92245f468b32ff21a61411de104364d8939f4
Author: Jiri Hnidek <jhnidek>
Date:   Fri Feb 7 15:30:44 2020 +0100

    Refactoring of DNF subscription-manager plugin; ENT-1906
    
    * Changed names of methods to be more pythonic
    * Do not try to get content overrides twice, when configuration
      option rhsm.full_refresh_on_yum is set to 1. Same optimization
      was implemented for YUM plugin
    * Added support for debug print to DNF subscription-manager plugin
    * Do not try to connect to candlepin server, when
      rhsm.full_refresh_on_yum is set to 0, because it is useless.
    * Changed one debug print in product-id plugin
    * Some long strings were split into more lines

Comment 33 errata-xmlrpc 2021-11-23 17:15:40 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-2021:4786

Comment 34 Red Hat Bugzilla 2023-09-18 04:26:38 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days