Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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.
Description of problem:
- Retain package versions option on the repository does not retain the specified number of package versions after synchronization.
Version-Release number of selected component (if applicable):
- satellite-7.0.0-0.5.beta.el7sat.noarch
- foreman-3.1.1.4-1.el7sat.noarch
How reproducible:
- Always
Steps to Reproduce:
1. Create a repository to sync a custom product.
2. On the upstream location, add one package and create the repodata.
3. Sync the repository on the Satellite with the following settings.
Retain Package: 1
Mirroring Policy: Additive
4. Add another package to the upstream location and recreate the repodata again.
5. Sync the repository on the Satellite with the following settings.
Retain Package: 2
Mirroring Policy: Additive
Actual results:
1. First Sync
The upstream repository:
~~~
# ls
kernel-4.18.0-80.el8.x86_64.rpm repodata
~~~
~~~
# hammer repository info --id 27
Id: 27
Name: CUSTOM_REPO_3
Label: CUSTOM_REPO_3
Description:
Organization: RedHat
Red Hat Repository: no
Content Type: yum
Mirror on Sync: no
Url: http://upstreamrepo.example.com/repos/satellite_custom_test_repo/
Publish Via HTTP: yes
Published At: https://satellite.example.com/pulp/content/RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3/
Relative Path: RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3
Download Policy: on_demand
Ignorable Content Units:
HTTP Proxy:
HTTP Proxy Policy: global_default_http_proxy
Product:
Id: 294
Name: CUSTOM_REPOSITORIES
GPG Key:
Sync:
Status: Success
Last Sync Date: 1 minute
Created: 2022/02/13 06:02:55
Updated: 2022/02/13 06:02:58
Content Counts:
Packages: 1
Source RPMS: 0
Package Groups: 0
Errata: 0
Module Streams: 0
~~~
~~~
name | base_path | relative_path
----------------------+---------------------------------------------------------+---------------------------------------------------------------
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.el8.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.el8.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.el8.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.el8.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.el8.x86_64.rpm
~~~
2. Second Sync after increasing the Retain Package versions to 2.
~~~
hammer> repository info --id 27
Id: 27
Name: CUSTOM_REPO_3
Label: CUSTOM_REPO_3
Description:
Organization: RedHat
Red Hat Repository: no
Content Type: yum
Mirror on Sync: no
Url: http://upstreamrepo.example.com/repos/satellite_custom_test_repo/
Publish Via HTTP: yes
Published At: https://satellite.example.com/pulp/content/RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3/
Relative Path: RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3
Download Policy: on_demand
Ignorable Content Units:
HTTP Proxy:
HTTP Proxy Policy: global_default_http_proxy
Product:
Id: 294
Name: CUSTOM_REPOSITORIES
GPG Key:
Sync:
Status: Success
Last Sync Date: 8 minutes
Created: 2022/02/13 06:02:55
Updated: 2022/02/13 06:09:52
Content Counts:
Packages: 1 <-------- Package count is still one.
Source RPMS: 0
Package Groups: 0
Errata: 0
Module Streams: 0
~~~
The package changed to the newest version from the upstream repository and the old version was removed.
name | base_path | relative_path
----------------------+---------------------------------------------------------+------------------------------------------------------
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
3. Added another package to the upstream repository and synced again with Retain Package Versions package value 5
Upstream Repository.
~~~
# ll
total 1228
-rw-r--r--. 1 root root 415364 May 14 2019 kernel-4.18.0-80.1.2.el8_0.x86_64.rpm
-rw-r--r--. 1 root root 419436 Jun 17 2019 kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
-rw-r--r--. 1 root root 409836 Mar 21 2019 kernel-4.18.0-80.el8.x86_64.rpm
drwxr-xr-x. 2 root root 4096 Feb 13 12:03 repodata
~~~
# zgrep metadata repodata/*primary*
repodata/caa37f79857badc4a11db3de3451b146364ebb76390c6b9e879ad6e6943800a9-primary.xml.gz:<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="3">
~~~
hammer> repository info --id 27
Id: 27
Name: CUSTOM_REPO_3
Label: CUSTOM_REPO_3
Description:
Organization: RedHat
Red Hat Repository: no
Content Type: yum
Mirror on Sync: no
Url: http://upstreamrepo.example.com/repos/satellite_custom_test_repo/
Publish Via HTTP: yes
Published At: https://satellite.example.com/pulp/content/RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3/
Relative Path: RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3
Download Policy: on_demand
Ignorable Content Units:
HTTP Proxy:
HTTP Proxy Policy: global_default_http_proxy
Product:
Id: 294
Name: CUSTOM_REPOSITORIES
GPG Key:
Sync:
Status: Success
Last Sync Date: 3 minutes
Created: 2022/02/13 06:02:55
Updated: 2022/02/13 06:37:24
Content Counts:
Packages: 1
Source RPMS: 0
Package Groups: 0
Errata: 0
Module Streams: 0
~~~
Similarly like before the package changed to the newer version but the older versions were removed even though the Retain Package Versions option is set to 5
name | base_path | relative_path
----------------------+---------------------------------------------------------+---------------------------------------------------------
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
CUSTOM_REPO_3-271771 | RedHat/Library/custom/CUSTOM_REPOSITORIES/CUSTOM_REPO_3 | Packages/k/kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
- Each time the repository is synced after adding new packages, the old packages are removed and the specified count of versions is not retained.
Expected results:
- The specified count of package versions should be synced.
Verified.
Version tested: Sat 6.11 snap 18.5
Steps:
1. Create a repo with a negative 'retain_package_versions_count'
2. Try to save the repo
3. After it fails, set the 'retain_package_versions_count' to a positive number
4. Save the repo
5. Ensure the correct 'retain_package_versions_count' is set
6. Sync the repo
Expected result:
The repo should sync the correct number of packages based on 'retain_package_versions_count'
Result:
The repo syncs the correct number of packages based on 'retain_package_versions_count'
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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498