Unable to synchronize repositories in Red Hat Satellite 6 due to sha1 or sha256 checksum errors

Solution Verified - Updated

Environment

Red Hat Satellite 6

Issue

  • Synchronizing repositories into Red Hat Satellite server fails with errors like these in /var/log/foreman/production.log:

    2020-01-01T00:00:00 [I|app|] Current user set to admin (regular)
    2020-01-01T00:00:00 [E|bac|] RPM1008: Checksum type "sha256" is not available for all units in the repository. Make sure those units have been downloaded. (Katello::Errors::PulpError)
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.41/app/lib/actions/pulp/abstract_async_task.rb:122:in `block in external_task='
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.41/app/lib/actions/pulp/abstract_async_task.rb:120:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.41/app/lib/actions/pulp/abstract_async_task.rb:120:in `external_task='
    /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.2.3/lib/dynflow/action/polling.rb:98:in `poll_external_task_with_rescue'
    

Resolution

  • Follow below steps on Satellite as a workaround of This content is not included.BugZilla 1850914:

    1. Deploy pulp-admin on Satellite machine.

    2. Use pulp-admin to find all srpms in the affected repository.

    # pass=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)
    # pulp-admin --username admin --password $pass repo list | egrep -A 2 "^$|^Id:|^Display|Rpm:|Srpm:" | egrep -v "Yum Repo Metadata|^Description" > srpms.txt
    

Look for Red Hat RPM repositories that contain more than zero SRPMs. (Third-party and custom repositories sometimes mix RPMs and SRPMs; this is usually fine, so ignore those repositories.) Here's an example:

Id:                  My_Organization-My_Lifecycle-Red_Hat_Enterprise_
                 Linux_7_Server_RPMs_x86_64_7Server
Display Name:        Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Content Unit Counts: 
--
  Rpm:                    29237
  Srpm:                   1

Notice that the Id line wraps after 48 characters. This is normal for the pulp-admin tool, and you may have to do some copying and pasting to recombine those lines for the next step.

  1. Use pulp-admin to remove all srpms for each affected repository in srpms.txt .

pass=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)

pulp-admin --username admin --password $pass rpm repo remove srpm --repo-id "<pulp_repo_id>" --filters '{}'

Note: Replace pulp_repo_id in above command with the ID of affected repository obtained from error trace in /var/log/foreman/production.log.

  1. Re-synchronize the affected repository using validate content sync.

  2. Remove the affected repositories from each capsule. To do this, first deploy pulp-admin on each capsule server.

  3. Next, run this command on each capsule server (where <pulp_repo_id> is the pulp repo ID you'd like to remove):

    pass=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)

    pulp-admin -u admin -p $pass rpm repo delete --repo-id "<pulp_repo_id>"

  4. Finally, republish and promote the related content views.

For more KB articles/solutions related to Red Hat Satellite 6.x Repository Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Repository Issues.

Root Cause

  • This is a known issue and Red Hat engineering team is working to resolve it (see This content is not included.BugZilla 1850914 ).

  • After the package has been deleted upstream, pulp is unable to verify the SRPM package's checksum, so it fails to delete it.

SBR
Product(s)
Components
Category

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.