Bug 2165906 - inconsistent metadata expiration times cause patch jobs to return no updates available
Summary: inconsistent metadata expiration times cause patch jobs to return no updates ...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.12.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.14.0
Assignee: ojanus
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On: 2172535 2172537 2172538
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-31 12:50 UTC by Taft Sanders
Modified: 2023-07-04 18:23 UTC (History)
13 users (show)

Fixed In Version: candlepin-4.1.22-1, candlepin-4.2.14-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2172535 2172537 2172538 2211963 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CANDLEPIN-506 0 None None None 2023-02-23 11:00:12 UTC
Red Hat Issue Tracker SAT-15624 0 None None None 2023-02-02 15:31:05 UTC
Red Hat Knowledge Base (Solution) 7007649 0 None None None 2023-04-14 12:59:48 UTC

Description Taft Sanders 2023-01-31 12:50:53 UTC
Description of problem:
Inconsistency in repo metadata expiration times causes invalid false positives on Satellite when updating hosts.

Version-Release number of selected component (if applicable):
candlepin-4.1.15-1.el8sat.noarch
satellite-6.12.0-4.el8sat.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Satellite clients are likely to miss updates on patching because of recently updated content views and clients still holding old repodata they still consider to be valid.

Expected results:
Satellite client's metadata_expire value should default to "1" and should be a customizable time in seconds on the content page of the Satellite settings for any user that wishes to set the time to anything else.

Additional info:
from satellite 6.12 fresh install:
[root@bombsat612 ~]# sudo -u postgres psql -d candlepin -c "select count(metadataexpire) from cp2_content where metadataexpire != 1;"
could not change directory to "/root": Permission denied
 count
-------
  5331
(1 row)
 
[root@bombsat612 ~]# sudo -u postgres psql -d candlepin -c "select count(metadataexpire) from cp2_content where metadataexpire = 1;"
could not change directory to "/root": Permission denied
 count
-------
  3512
(1 row)
 
[root@bombsat612 ~]# sudo -u postgres psql -d candlepin -c "select distinct(metadataexpire) from cp2_content;"
could not change directory to "/root": Permission denied
 metadataexpire
----------------
              1
          86400
(2 rows)
 
 
 
Here are 2 ruby functions where we set the time (i believe if the product is not set by default):
/usr/share/gems/gems/katello-4.5.0.20/app/lib/actions/candlepin/product/content_create.rb:24:                     metadataExpire: 1,
/usr/share/gems/gems/katello-4.5.0.20/app/lib/actions/candlepin/product/content_update.rb:28:                     metadataExpire: 1,
 
 
 
Looking at the manifest on the 6.12 satellite and comparing with another from 2022:
tasander at xbox in /t/e/products
↪ for i in $(ls -1);cat $i | jq | grep metadataExpiration ; end | sort | uniq -c
   8018             "metadataExpiration": 86400,
   8018         "metadataExpiration": 86400,
 
[root@bombsat610 products]# for i in $(ls -1); do cat $i | json_reformat | grep metadataExpiration ; done | sort | uniq -c
   1310                 "metadataExpiration": 86400,
      4                 "metadataExpiration": 86401,
      4                 "metadataExpiration": 86402,

Comment 1 Brad Buckingham 2023-02-02 15:28:02 UTC
Is this a regression from 6.11?  Thanks!

Comment 2 Chris Roberts 2023-02-02 19:26:44 UTC
Brad,

This has been there since 6.0

Comment 3 Jeremy Lenz 2023-02-21 15:41:00 UTC
After discussion with Candlepin team and rjerrido, setting component to Candlepin.

For standalone Candlepin, metadataExpire should be getting set to 1 during manifest import.

Comment 5 ojanus 2023-02-23 11:02:19 UTC
This was fixed in Candlepin 4.2.

Comment 7 Brad Buckingham 2023-02-23 17:02:37 UTC
Moving to POST based upon comment 4 and 5.

Comment 9 Nikos Moumoulidis 2023-02-27 15:58:35 UTC
A note on this: Once you upgrade to a candlepin version with the fix for this, you will need to refresh your manifest for the metadataexpire value in the database to change

Comment 10 Patrick Creech 2023-06-14 19:08:28 UTC
Is there a version of candlepin 4.3.z that this fix is in?

Comment 11 Jeremy Lenz 2023-06-14 19:11:43 UTC
Patrick- I'm not sure. Nikos would know better..  @nmoumoul

Comment 12 Nikos Moumoulidis 2023-06-15 07:34:15 UTC
(In reply to Patrick Creech from comment #10)
> Is there a version of candlepin 4.3.z that this fix is in?

This fix should be in all 4.3.z versions (starting with 4.3.0), since it was fixed before the bump to 4.3.
I would recommend using the latest as of now (4.3.6)

Comment 13 Gaurav Talreja 2023-07-04 18:23:32 UTC
Verified.

Tested on Satellite 6.14.0 Snap 6.0
Version: candlepin-4.3.1-1.el8sat.noarch

Steps:
1. Imported manifest, enabled few repositories, created and publish CV, Create AK with this CV
2. Register a client with AK create above and check /etc/yum.repos.d/redhat.repo for metadata_expire 
# cat /etc/yum.repos.d/redhat.repo | grep metadata_expire
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1
metadata_expire = 1

3. Also tried checking the candlepin DB for cp2_content table and there's also metadata_expire set 1
# sudo -u postgres psql -d candlepin -c "select distinct(metadataexpire) from cp2_content;"
could not change directory to "/root": Permission denied
 metadataexpire
----------------
              1
(1 row)


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