Satellite client flooded by yum warnings about errata "is broken, or a bad duplicate, skipping."

Solution Verified - Updated

Environment

  • Red Hat Satellite6
    • Content Hosts most probably on RHEL7 only

Issue

Having a Content Host (most probably RHEL7) of Satellite6, a few yum commands like yum check-update print a long list of warnings about bad/duplicate errata - see Diagnostic Steps for more.

How to surpress or prevent these warnings?

Resolution

In a nutshell, republish metadata of affected Content Views (non-composite first, then composite).

  • have a tiny script find_rhel-or-extras.updateinfos.py - here it is assumed the conflicting repos are rhel-7-server-rpms and rhel-7-server-optional-rpms. If not, update base paths accordingly:
from pulp_rpm.app.models.repository import RpmDistribution, RpmPublication

query = RpmDistribution.objects.filter(base_path__contains='/content/dist/rhel/server/7/7Server/x86_64/os') \
        | RpmDistribution.objects.filter(base_path__contains='/content/dist/rhel/server/7/7Server/x86_64/optional/os')

for rpmd in query.all():
    fpath = rpmd.publication.published_metadata.get(relative_path__contains='updateinfo.xml') \
                .contentartifact_set.first().artifact.file.path
    print(f"{rpmd.base_path} {fpath}")

  • run it on Satellite - customize errata id (RHSA-2018:0350 used below) per the yum warning; here we assume the errata differ in issued date value (often the case) - to see the difference in errata details, copy and gunzip the files /var/cache/yum/*/repodata/*-updateinfo.xml.gz for the two repos, open the files and find differences for some affected errata. If some other detail than issued date is different, modify the zgrep accordingly.
cat find_rhel-or-extras.updateinfos.py | sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager shell | while read p f; do echo -e "$(zgrep -A3 '<id>RHSA-2018:0350</id>' $f | grep "issued date")\t$p"; done
  • output will be like (here for RedHat Organization):
    <issued date="2018-02-26 17:04:59"/>	RedHat/Library/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/TEST/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/Library/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/Library/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/TEST/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/Library/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os

where IDEALLY all dates with "UTC" should be only for <organization>/Library/content (i.e. Default CV)

  • if you see some other output, like:
    <issued date="2018-02-26 17:04:59"/>	RedHat/Library/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/TEST/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/Library/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/Library/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59"/>	RedHat/TEST/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/Library/content/dist/rhel/server/7/7Server/x86_64/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
    <issued date="2018-02-26 17:04:59 UTC" />	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os

(or e.g. some timestamps will have different date/time than others), then lines (in our particular example):

<issued date="2018-02-26 17:04:59 UTC" />	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os
<issued date="2018-02-26 17:04:59 UTC" />	RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/os

are "wrong" and we need to republish given CV (cv_rhel7 here) in the version promoted to given LE (DEV here).

  • For each such "wrong" CV/LE, repeat below steps. Chose non-composite CVs first and then composite ones.

  • For each particular CV/LE, let republish metadata of CV version check what CV version - run below pair of commands for all CV/LE pairs - just customize the relative_path and --organization-label:

# cvvid=$(su - postgres -c "psql foreman -c \"COPY (SELECT content_view_version_id FROM katello_repositories WHERE relative_path = 'RedHat/DEV/cv_rhel7/content/dist/rhel/server/7/7Server/x86_64/optional/os') TO STDOUT\"")

hammer content-view version republish-repositories --id $cvvid --force 1 --organization RedHat
  • wait until the task completes (on cmdline, you can monitor its progress in WebUI as well), then run the python script again to check if it helped.

  • repeat the procedure for all LE/CV that have the "UTC" - ideally start with non-composite CVs and have composite CVs at the end.

  • once all CVs are fixed, ensure the content is properly synced to external Capsules (if applicable).

  • then, on any affected client, clean cached metadata:

yum clean all
  • new yum commands should not further print the warnings

When the above does not help or issued date is correct

When the above does not help or issued date is correct, publishing a new version of the Content View should be a valid workaround. Please contact Red Hat suppoert if that is not possible for you.

Diagnostic Steps

Various yum commands fail with below error on arbitrary errata:

yum check update
..
Update notice RHSA-2021:0992 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
Update notice RHSA-2021:5014 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
Update notice RHSA-2020:1016 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
..
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.