Bug 2024573
| Summary: | refresh command removes SCA certificate cache before it can be used | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Nikos Moumoulidis <nmoumoul> | |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> | |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 8.4 | CC: | arpandey, cdonnell, jhnidek, redakkan | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | 8.6 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | subscription-manager-1.28.27-1.el8 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2026316 (view as bug list) | Environment: | ||
| Last Closed: | 2022-05-10 15:22:58 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: | 2024589, 2026316 | |||
reproducer: We will verify the issue by checking call to /accessible_content as the 'If-Modified-Since' header is not sent in the call to server if cache is not there
[root@kvm-01-guest11 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.28.25-1.el8
[root@kvm-01-guest11 ~]#
[root@kvm-01-guest11 ~]# subscription-manager register --username rhel9GA --password ******
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: fb237d68-531e-481f-b021-ca77af6fc195
The registered system name is: kvm-01-guest11.lab.eng.rdu2.redhat.com
[root@kvm-01-guest11 ~]#
[root@kvm-01-guest11 ~]# export SUBMAN_DEBUG_PRINT_REQUEST=1 SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1
[root@kvm-01-guest11 ~]# subscription-manager refresh
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/fb237d68-531e-481f-b021-ca77af6fc195/certificates/serials {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.el8', 'X-Correlation-ID': '236390585869467d808ccaf4686d90b9', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/status {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.el8', 'X-Correlation-ID': '236390585869467d808ccaf4686d90b9', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/fb237d68-531e-481f-b021-ca77af6fc195/accessible_content {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.el8', 'X-Correlation-ID': '236390585869467d808ccaf4686d90b9', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.el8', 'Content-Length': '0'} <<<<<<<<<<<<< 'If-Modified-Since' header is not sent due to cache not being there
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/fb237d68-531e-481f-b021-ca77af6fc195/content_overrides {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.el8', 'X-Correlation-ID': '236390585869467d808ccaf4686d90b9', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.el8', 'Content-Length': '0'}
All local data refreshed
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/fb237d68-531e-481f-b021-ca77af6fc195/compliance {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.el8', 'X-Correlation-ID': '236390585869467d808ccaf4686d90b9', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.el8', 'Content-Length': '0'}
=======================================================================================
preverifying on jenkins build- subscription-manager-1.28.25-1.git.9.941b9d3.el8.x86_64
[root@kvm-01-guest11 ~]#
[root@kvm-01-guest11 ~]# yum upgrade subscription-manager
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 3.6 MB/s | 10 MB 00:02
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs) 2.4 MB/s | 4.1 MB 00:01
Jenkins CI builds of Red Hat Subscription Manager for RHEL 143 kB/s | 32 kB 00:00
:
<output omitted>
:
Verifying : subscription-manager-rhsm-certificates-1.28.25-1.git.9.941b9d3.el8.x86_64 11/12
Verifying : subscription-manager-rhsm-certificates-1.28.16-1.el8.x86_64 12/12
Installed products updated.
Upgraded:
dnf-plugin-subscription-manager-1.28.25-1.git.9.941b9d3.el8.x86_64 python3-cloud-what-1.28.25-1.git.9.941b9d3.el8.x86_64
python3-subscription-manager-rhsm-1.28.25-1.git.9.941b9d3.el8.x86_64 python3-syspurpose-1.28.25-1.git.9.941b9d3.el8.x86_64
subscription-manager-1.28.25-1.git.9.941b9d3.el8.x86_64 subscription-manager-rhsm-certificates-1.28.25-1.git.9.941b9d3.el8.x86_64
Complete!
[root@kvm-01-guest11 ~]#
[root@kvm-01-guest11 ~]#
[root@kvm-01-guest11 ~]# subscription-manager refresh
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/32ee0e69-4e58-4920-926d-e391bf3382c7/certificates/serials {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.git.9.941b9d3.el8', 'X-Correlation-ID': '6b711c7ea1654ce684fe4db8768b5f5e', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.git.9.941b9d3.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/status {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.git.9.941b9d3.el8', 'X-Correlation-ID': '6b711c7ea1654ce684fe4db8768b5f5e', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.git.9.941b9d3.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/32ee0e69-4e58-4920-926d-e391bf3382c7/accessible_content {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.git.9.941b9d3.el8', 'X-Correlation-ID': '6b711c7ea1654ce684fe4db8768b5f5e', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.git.9.941b9d3.el8', 'Content-Length': '0', 'If-Modified-Since': 'Thu, 20 Jan 2022 15:33:28 GMT'}
^^^^^^^^^^^^^^^^ 'If-Modified-Since' header present
All local data refreshed
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/32ee0e69-4e58-4920-926d-e391bf3382c7/compliance {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.25-1.git.9.941b9d3.el8', 'X-Correlation-ID': '6b711c7ea1654ce684fe4db8768b5f5e', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.25-1.git.9.941b9d3.el8', 'Content-Length': '0'}
Verification Results: 'If-Modified-Since' header is being sent in the request verifies that content_access.json cache is not removed in between.
Based on above observation setting verified field to tested.
Verifying on nightly build with subscription-manager-1.28.28-1.el8.x86_64
Beaker Test information:
HOSTNAME=hpe-dl380pgen8-02-vm-16.hpe2.lab.eng.bos.redhat.com
JOBID=6324461
RECIPEID=11496978
RESULT_SERVER=
DISTRO=RHEL-8.6.0-20220220.3
ARCHITECTURE=x86_64
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
Steps to verify:
verifying the issue by checking presence of 'If-Modified-Since' header in '/accessible_content' call
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.28.28-1.el8
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# timedatectl set-timezone Europe/Paris
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager register --username rhel9GA --password ******
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 9c986abc-78c6-4d45-8a39-1c96e3c6bc34
The registered system name is: hpe-dl380pgen8-02-vm-16.hpe2.lab.eng.bos.redhat.com
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# rpm -qa --changelog subscription-manager | grep 2024573
- 2024573: [1.28] Do not delete cache of content_access during refresh
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# cut -d ',' -f1 /var/lib/rhsm/cache/content_access.json
{"lastUpdate": "2022-02-21T10:28:05+0000"
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# export SUBMAN_DEBUG_PRINT_REQUEST=1 SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1
[root@hpe-dl380pgen8-02-vm-16 ~]#
[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager refresh
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/9c986abc-78c6-4d45-8a39-1c96e3c6bc34/certificates/serials {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.28-1.el8', 'X-Correlation-ID': '8eef2838fb7f454daaeb941d719397bb', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.28-1.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/status {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.28-1.el8', 'X-Correlation-ID': '8eef2838fb7f454daaeb941d719397bb', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.28-1.el8', 'Content-Length': '0'}
Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/9c986abc-78c6-4d45-8a39-1c96e3c6bc34/accessible_content {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.28-1.el8', 'X-Correlation-ID': '8eef2838fb7f454daaeb941d719397bb', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.28-1.el8', 'Content-Length': '0', 'If-Modified-Since': 'Mon, 21 Feb 2022 10:28:05 GMT'}
^^^^^-------------------------------------------header sent in request
All local data refreshed
:
:
:
[root@dell-per630-fc-01 ~]#
Verification Results: 'If-Modified-Since' header is being sent in the request verifies that content_access.json cache is not removed in between.
Verification : Passed
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-2022:2047 |
Description of problem: While being registered against an org with SCA enabled, running various subscription-manager commands, but most importantly 'refresh' and 'repos', subscription-manager deletes the SCA certificate cache, before it can be re-used (by sending the If-Modified-Since header to Candlepin). Version-Release number of selected component (if applicable): These are the ones I tried, but it's probably most versions of subman: 1.28.13-2.el8 1.29.18-1.fc33 How reproducible: 100% Steps to Reproduce: 1. Register to an org with SCA mode 2. Validate that the /var/lib/rhsm/cache/content_access.json file is there, and has content. 3. Attach a debugger to the Candlepin server 4. Set debug points to these this endpoint: /consumers/{consumer_uuid}/accessible_content (The reason is to be able to stop execution between subman HTTP requests and check the client's filesystem for the cache file) 5. Run 'subscription-manager refresh' (or 'repos' 6. When the debugger stops on the '/accessible_content' call, check the /var/lib/rhsm/cache/content_access.json file on the client filesystem. Actual results: [nikos@localhost ~]$ sudo ls /var/lib/rhsm/cache/content_access.json ls: cannot access '/var/lib/rhsm/cache/content_access.json': No such file or directory Expected results: The /var/lib/rhsm/cache/content_access.json file to be there, and populated properly. Additional info: If you continue the debugging session, you will see that once that call is done, only then is the cache re-created, and then only on the second call to /accessible_content the If-Modified-Since header is set. If you want you can also set the two HTTP debug variables when running refresh: SUBMAN_DEBUG_PRINT_REQUEST=1 SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1 and you will see that the first call to /accessible_content does not send the If-Modified-Since header (since the cache is simply not there): Making insecure request: 192.168.122.179:8443 GET /candlepin/consumers/ab292bd8-3976-4fee-96b9-67ead1e13a13/accessible_content {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.13-2.el8', 'X-Correlation-ID': 'a10924cebda844859a83d5fbd20ce41a', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.13-2.el8', 'Content-Length': '0'} ... Making insecure request: 192.168.122.179:8443 GET /candlepin/consumers/ab292bd8-3976-4fee-96b9-67ead1e13a13/accessible_content {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.13-2.el8', 'X-Correlation-ID': 'a10924cebda844859a83d5fbd20ce41a', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.13-2.el8', 'Content-Length': '0', 'If-Modified-Since': 'Thu, 18 Nov 2021 10:12:49 GMT'}