"[Errno -1] Package does not match intended download" error when installing packages from Satellite server

Solution Verified - Updated -

Environment

  • Red Hat Network Satellite
  • Red Hat Enterprise Linux 5.x

Issue

  • While trying to install packages from i386 custom channel through satellite server, following error persists on client system:

    perl-Nagios-Plugin-0.33-1.el5.rf.noarch: failed to retrieve getPackage/perl-Nagios-Plugin-0.33-1.el5.rf.noarch.rpm from nagios_server_513 kB     00:00
    error was [Errno -1] Package does not match intended download
    
  • md5sum doesn't match

  • executing the "file" command on the rpm under /var/satellite on the server identifies the file as data, not as an RPM

Resolution

  • Run the following script on the Satellite server to find all packages in /var/satellite that do not have the expected checksum (md5sum or sha256sum when relevant) :
# python check-varsat.py
  • After reviewing the output, delete the corrupt files

  • Before running satellite-sync command, clear cache on satellite server by running following command:

# rm -fr /var/cache/rhn/satsync/*

Note : if the corruption repeats and you are using location aware updates on the satellite's rhn profile, disable it for a test to see if your problem comes from a bad mirror.

  • Re-sync the channels with the satellite-sync command, to restore the correct rpms :
# satellite-sync -c CHANNEL1 -c CHANNEL2

it is also possible to use a normal full sync :

# satellite-sync

the script check-varsat.py is a simple checksum checker which is attached to this article and offers you to remove the packages which do not have their expected checksum ; it is also available on this github

Alternative method

The checksum method works - but it involves reading all the content of all rpms, which can take a long time. This other method will only base itself on the data of the rpm files :

for i in `find /var/satellite -iname "*.rpm"`
do
        rpm -vK $i 2>&1 | grep -v $i | grep -q "error" && echo "$i is corrupt"
done

to list the rpms then

for i in `find /var/satellite -iname "*.rpm"`
do
        if rpm -vK $i 2>&1 | grep -v $i | grep -q "error"

        then

             rm -f $i

             echo "deleted corrupt rpm $i"

        fi
done

to remove them. However in some scenarios if the downloaded rpm is valid but not what was expected to be downloaded, this method won't pick it.

Root Cause

  • Packages (rpm) files corrupted or missing during download with satellite-sync.

Attachments

  • Component
  • rpm

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments