Bug 2037508

Summary: upload-content results in wrong RPM being added to product
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Stephen Wadeley <swadeley>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: ahumbe, egolov, pcreech, swadeley, vsedmik
Target Milestone: 6.11.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:31:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Sherrill 2022-01-05 18:50:44 UTC
Uploading an RPM via the webui Product->Repository view, or hammer repository upload-content is accepting an RPM successfully, but then when looking inside the repository package list, a completely different RPM has been added. No errors or warnings are recorded in foreman.log or in journalctl on the foreman host.

Initially I was building a local RPM for a package using the fedora ~ style pre-release version number. Thinking that might be the cause, I rebuild the package using several different version numbering schemes. All resulted in the same behaviour, as did downloading a random RPM from the web, and trying to upload that instead.

In all cases the package that was actually added to the repository instead of the uploaded one was `perl-Data-MessagePack-1.01-6.el8.src`


```
[root@whitefall ~]# hammer package list --product Sihnon --organization sihnon --repository-id=1397
-------|--------------------------------------------|----------------------------------------
ID     | FILENAME                                   | SOURCE RPM
-------|--------------------------------------------|----------------------------------------
239429 | nomad-driver-podman-0.3.0-1.el8.x86_64.rpm | nomad-driver-podman-0.3.0-1.el8.src.rpm
256881 | rpmrebuild-2.11-3.el8.noarch.rpm           | rpmrebuild-2.11-3.el8.src.rpm
256880 | zfs-auto-snapshot-1.2.4-2.el8.x86_64.rpm   | zfs-auto-snapshot-1.2.4-2.el8.src.rpm
-------|--------------------------------------------|----------------------------------------

[root@whitefall ~]# hammer repository upload-content --product Sihnon --organization sihnon --path /home/ben/rpmbuild/RPMS/x86_64/nomad-driver-podman-0.4.0~git20211223.7e3d0182-1.el8.x86_64.rpm  --name 'Everything (EL8)'
Successfully uploaded file 'nomad-driver-podman-0.4.0~git20211223.7e3d0182-1.el8.x86_64.rpm'

[root@whitefall ~]# hammer package list --product Sihnon --organization sihnon --repository-id=1397
-------|--------------------------------------------|----------------------------------------
ID     | FILENAME                                   | SOURCE RPM
-------|--------------------------------------------|----------------------------------------
239429 | nomad-driver-podman-0.3.0-1.el8.x86_64.rpm | nomad-driver-podman-0.3.0-1.el8.src.rpm
262972 | perl-Data-MessagePack-1.01-6.el8.src.rpm   |
256881 | rpmrebuild-2.11-3.el8.noarch.rpm           | rpmrebuild-2.11-3.el8.src.rpm
256880 | zfs-auto-snapshot-1.2.4-2.el8.x86_64.rpm   | zfs-auto-snapshot-1.2.4-2.el8.src.rpm
-------|--------------------------------------------|----------------------------------------
```

Also tried:
- Installing the latest nightly packages
- Re-running the installer
- Rebooting the host
- Adding RPMs to another repository within the same Product

In all cases, regardless of what the actual RPM is being uploaded is, or what the filename is, the package that gets added to the repository is the same.

Installed versions:
```
[root@whitefall ~]# rpm -qa '*foreman*' '*katello*'
foreman-debug-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
katello-common-4.4.0-0.1.master.el8.noarch
foreman-installer-3.2.0-0.1.develop.20211222031310gite34bd78.el8.noarch
nodejs-theforeman-builder-8.16.0-1.el8.noarch
foreman-postgresql-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
katello-server-ca-1.0-1.noarch
katello-selinux-4.0.2-1.el8.noarch
rubygem-foreman_maintain-1.0.1-1.el8.noarch
foreman-proxy-3.2.0-0.1.develop.20211221171439gitd60623c.el8.noarch
whitefall.jellybean.sihnon.net-foreman-proxy-1.0-3.noarch
katello-debug-4.4.0-0.1.master.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch
katello-repos-4.4-0.2.nightly.el8.noarch
rubygem-foreman_puppet-3.0.0-1.fm3_2.el8.noarch
foreman-build-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
foreman-vmware-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
rubygem-katello-4.4.0-0.2.pre.master.20211201084334git73323fb.el8.noarch
foreman-cli-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
nodejs-theforeman-vendor-8.16.0-1.el8.noarch
katello-default-ca-1.0-1.noarch
foreman-release-3.2.0-0.1.develop.el8.noarch
katello-certs-tools-2.8.2-1.el8.noarch
foreman-selinux-3.2.0-0.1.develop.20211214154721git4adc0e4.el8.noarch
rubygem-foreman-tasks-core-0.3.5-1.fm2_5.el8.noarch
foreman-installer-katello-3.2.0-0.1.develop.20211222031310gite34bd78.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.16-1.fm3_0.el8.noarch
katello-4.4.0-0.1.master.el8.noarch
foreman-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
foreman-dynflow-sidekiq-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
foreman-assets-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
foreman-service-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
rubygem-foreman_remote_execution_core-1.4.4-1.el8.noarch
rubygem-hammer_cli_foreman_puppet-0.0.4-1.fm3_1.el8.noarch
rubygem-foreman-tasks-5.3.0-1.fm3_2.el8.noarch
rubygem-hammer_cli_katello-1.4.0-0.1.pre.master.20211125093815git3fea315.el8.noarch
rubygem-hammer_cli_foreman-3.2.0-0.1.pre.develop.20211221151210git1f7fad5.el8.noarch
rubygem-foreman_remote_execution-5.1.0-1.fm3_2.el8.noarch
foreman-plugin-3.2.0-0.2.develop.20211221193908gita6471d0.el8.noarch
katello-client-bootstrap-1.7.7-1.el8.noarch
```

Attached is the output of `hammer --debug repository upload-content --product Sihnon --organization sihnon --path /home/ben/rpmbuild/RPMS/x86_64/nomad-driver-podman-0.4.0~git20211223.7e3d0182-1.el8.x86_64.rpm  --name 'Everything (EL8)' 2>&1`.

Comment 1 Justin Sherrill 2022-01-05 18:50:48 UTC
Created from redmine issue https://projects.theforeman.org/issues/34202

Comment 2 Justin Sherrill 2022-01-05 18:50:49 UTC
Upstream bug assigned to None

Comment 3 Justin Sherrill 2022-01-05 18:54:18 UTC
This was an upstream bug that we are investigating

Comment 4 Justin Sherrill 2022-01-27 20:24:58 UTC
*** Bug 2042854 has been marked as a duplicate of this bug. ***

Comment 5 Bryan Kearney 2022-02-01 00:05:08 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34202 has been resolved.

Comment 6 Stephen Wadeley 2022-02-08 08:18:49 UTC
Hi

taking QA as agreed with chiggins who is on PTO

Comment 8 Justin Sherrill 2022-02-17 19:00:42 UTC
*** Bug 2050217 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2022-07-05 14:31:37 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 (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