Bug 1757613

Summary: yum --downloadonly fails with "Downloaded package <Package>, from rhel-x86_64-server-7, but it was invalid." when run against Satellite 5 repos
Product: Red Hat Enterprise Linux 7 Reporter: jcastran
Component: yumAssignee: Lukáš Hrázký <lhrazky>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact:
Priority: high    
Version: 7.6CC: carl, james.antill, jss, lhrazky, mark.hyde, mdomonko, paul.rotering, paul.whitaker, rotering, sam.patwin, snejoshi, stefan.strandberg, tborcin
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-167.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 20:03:32 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:

Description jcastran 2019-10-01 21:19:00 UTC
Description of problem:
yum --downloadonly fails with "Downloaded package <Package>, from rhel-x86_64-server-7, but it was invalid." when run against Satellite 5 repos

Version-Release number of selected component (if applicable):
yum-3.4.3-163.el7.noarch

How reproducible:
Everytime

Steps to Reproduce:
1. Register RHEL 7 to Satellite 5
2. Update yum to latest
3. yum update --downloadonly

Actual results:
Error downloading packages:
  1:NetworkManager-tui-1.18.0-5.el7_7.1.x86_64: Downloaded package 1:NetworkManager-tui-1.18.0-5.el7_7.1.x86_64, from rhel-x86_64-server-7, but it was invalid.
  glib2-2.56.1-5.el7.x86_64: Downloaded package glib2-2.56.1-5.el7.x86_64, from rhel-x86_64-server-7, but it was invalid.
  1:NetworkManager-ppp-1.18.0-5.el7_7.1.x86_64: Downloaded package 1:NetworkManager-ppp-1.18.0-5.el7_7.1.x86_64, from rhel-x86_64-server-7, but it was invalid.
  1:NetworkManager-1.18.0-5.el7_7.1.x86_64: Downloaded package 1:NetworkManager-1.18.0-5.el7_7.1.x86_64, from rhel-x86_64-server-7, but it was invalid.
  1:NetworkManager-team-1.18.0-5.el7_7.1.x86_64: Downloaded package 1:NetworkManager-team-1.18.0-5.el7_7.1.x86_64, from rhel-x86_64-server-7, but it was invalid.
  1:NetworkManager-libnm-1.18.0-5.el7_7.1.x86_64: Downloaded package 1:NetworkManager-libnm-1.18.0-5.el7_7.1.x86_64, from rhel-x86_64-server-7, but it was invalid.


Expected results:
yum downloads the packages without error.

Additional info:
It seems to be a regression of this patch.
   http://pkgs.devel.redhat.com/cgit/rpms/yum/commit/?h=rhel-7.7&id=199541657305d163b8b14955e053b4d83cfa9458

Comment 2 Stefan Strandberg 2019-10-08 15:46:58 UTC
We are seeing this as well.  It is creating a lot of warning noise and alerts from our automated patching system as it thinks all the pre-downloads are failing, even though they end up in the correct location and properly cached for use when patching.

If I can provide any more information to help get this resolved, please let me know.

Thanks!

Comment 3 Daniel Mach 2019-11-27 11:19:52 UTC
Is the problem only with the listed packages in comment#0 or with all packages?
Could you also verify that downgrading yum to an older version fixes the problem?

By any chance don't you have a host/vm/container in which the problem is reproducible so we can debug it there?

Comment 4 Stefan Strandberg 2019-11-27 13:20:18 UTC
All packages from any repositories that are on the spacewalk server.  Downgrading to yum-3.4.3-161.0.1.el7.noarch is a workaround and is what we've currently done, enforcing via config management.

I will check with management to see if I can give you ssh access to a test VM that's subscribed to our Spacewalk server, but it wouldn't be until after Thanksgiving.

As a note, our site is using Oracle Linux 7, and we have opened a case with them as well, but the bug is not specific to Oracle Linux and affects RHEL the same.  If you would prefer a straight RHEL setup to test on, I understand.

Thanks,

-stefan

Comment 6 Stefan Strandberg 2019-12-03 17:25:20 UTC
We should be able to give you access to a VM.  Please e-mail me at my account address and we can coordinate.

Thanks,

-stefan

Comment 7 Lukáš Hrázký 2019-12-17 14:24:47 UTC
PR: https://github.com/rpm-software-management/yum/pull/112

Thanks Stefan for providing the VM!

Comment 8 Michal Domonkos 2020-01-07 13:54:49 UTC
Easy reproducer:

1) Add "async=0" to /etc/yum.repos.d/<my-repo>.repo
2) # yum install <package-from-my-repo> --downloadonly
[...]
Error downloading packages:                                                                                                                                                                    
  <package-from-my-repo>: Downloaded package <package-from-my-repo>, from <my-repo>, but it was invalid.

Note that this issue is only triggered when "async" is disabled, because of the verifyLocalPkg() check that looks at the now incorrect po.localpath value:
https://github.com/rpm-software-management/yum/blob/3da1a101937f62b2e4836346d096d3c745bf34fd/yum/yumRepo.py#L1077

The patch by Lukash fixes this.

Comment 18 Stefan Strandberg 2020-03-03 18:33:47 UTC
Hi,

I hate to press but when can we expect to see the fix released?

Thanks,

-stefan

Comment 19 Michal Domonkos 2020-03-04 14:01:29 UTC
Hi Stefan,

The fix is currently planned to be released in the next RHEL-7 minor release.

Comment 21 errata-xmlrpc 2020-03-31 20:03:32 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, 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-2020:1122

Comment 22 John 2020-04-14 08:01:26 UTC
Thanks for wasting another half an hour of my life.

Also... extra, and much more sincere thanks, for fixing it just quick enough that I don't have to log a bug report myself.