Satellite does not allow to push package if it is built with same NVERA on different RHEL release.

Solution Verified - Updated -

Environment

  • Red Hat Network Satellite v 5.3
  • Red Hat Enterprise Linux

Issue

  • While pushing pacakge on satellite server it fails following error

    Error: Package name-1.3.3-1.i386.rpm already exists on the server with a different checksum. Skipping upload to prevent overwriting existing package. (You may use rhnpush with the --force option to force this upload if the force_upload option is enabled on your server.) 
    

While uploading three different versions of name-1.3.3 - one for Red Hat Enterprise Linux 3 , one for Red Hat Enterprise Linux 4 and one for Red Hat Enterprise Linux 5, satellite just seems to look at the name and doesn't understand that although they have the same name, they are built for different Red Hat Enterprise Linux versions.

  • While adding/pushing packages with different name/size in custom channel with rhnpush command, fails with error "Package XYZ already exists on the server with a different checksum".
  • When we push different package with different size for Red Hat Enterprise Linux 4 version to a Red Hat Enterprise Linux 4 channel, the package replaces the one in the Red Hat Enterprise Linux 5 channel.

Resolution

If we build package name-1.3.3-1.i386.rpm (with same name,version,architecture) for Red Hat Enterprise Linux 3 , Red Hat Enterprise Linux 4 , Red Hat Enterprise Linux 5, then to differentiates between the Red Hat Enterprise Linux 3, 4 and 5 packages we need to add distribution in release field as el3, el4 and el5 respectively OR we can add any other name to identify it.

So ideally the package should look like name-1.0.30-1.el5.i386.rpm .

Respectively we need to modify the spec file before building  the package. Following is the example.

Name: name
Version: 1.0.30
Release: 1.%{?dist}
  • Modify package version in the rpm spec file for packages which have same package name but different size and then rebuild those packages.

  • If we want to change the package name then respective "spec" file should be changed before building package. So that it will reflect the change in package name / package version automatically.

  • If you can't change the package name or version then refer - https://access.redhat.com/kb/docs/DOC-26363 to delete the old package and push the new package.

Root Cause

  • Satellite check the Name, Version, Release, Epoch, Architecture of the package while pushing it, to avoid duplicate records/packages and differentiates between the packages. It does not check system where the package is built, even those details are not even stored in the rpm headers, so we need to use distribution in release field of the spec file while building the package.

  • The package filename is different for packages which are changed manually after building package.

  • Spec file for these packages was not properly updated before building package.

Diagnostic Steps

  • Package details which are being pushed :

For instance, there are 64 bit RPMs, for Red Hat Enterprise Linux 4 and Red Hat Enterprise Linux 5.

We can see that they are different in size and package file name

         -rw-r--r-- 1 p656905 wheel  7191661 Aug 14  2009 EMCpower.LINUX-5.3.0.00.00-185.rhel5.i386.rpm
         -rw-r--r-- 1 p656905 wheel 25758515 Aug 14  2009 EMCpower.LINUX-5.3.0.00.00-185.rhel.i386.rpm
  • Try to push these packages in custom channel
   # rhnpush --channel=rhel5-test --username=username --password=password --server=http://xx.xx.xx.xx/APP -vv EMCpower.LINUX-5.3.0.00.00-185.rhel5.i386.rpm --nosig
        Connecting to http://xx.xx.xx.xx/APP
        url is http://xx.xx.xx.xx/PACKAGE-PUSH
        Result codes: 200 OK
        Computing md5sum and package Info .This may take sometime ...
        Package EMCpower.LINUX-5.3.0.00.00-185.rhel5.i386.rpm Not Found on RHN Server -- Uploading
        Uploading package EMCpower.LINUX-5.3.0.00.00-185.rhel5.i386.rpm
        Using POST request
  • First package got pushed successfully.
  # rhnpush --channel=rhel4-test --username=username --password=password --server=http://xx.xx.xx.xx/APP -vv EMCpower.LINUX-5.3.0.00.00-185.rhel.i386.rpm --nosigConnecting to http://xx.xx.xx.xx/APP
    url is http://xx.xx.xx.xx/PACKAGE-PUSH
    Result codes: 200 OK
    Computing md5sum and package Info .This may take sometime ...
    Error: Package EMCpower.LINUX-5.3.0.00.00-185.rhel.i386.rpm already exists on the server with a different checksum. Skipping upload to prevent overwriting existing package. (You may use rhnpush with the --force option to force this upload if the force_upload option is enabled on your server.)
  • While pushing second package it says that the package already exist on satellite server even though the file name is different for both packages.

  • Check the package details like :-  " Name , Version , Release , Architecture " using rpm query command.

  # rpm -qp --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n"  EMCpower.LINUX-5.3.0.00.00-185.rhel.i386.rpm EMCpower.LINUX-5.3.0.00.00-185.rhel5.i386.rpm

        EMCpower.LINUX-5.3.0.00.00-185-i386
        EMCpower.LINUX-5.3.0.00.00-185-i386
  • Here we can see that the package name appears duplicate, as there are multiple entries so satellite takes it as same package. Here file names are different but while building the packages for same architecture spec file was not properly updated.

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