I decided to try playing with dnf-4.0.9.2-1.el7_6.noarch from
7x/external_products/extras/x86_64. But whenever I attempt any dnf
operation with the main SL7 repository configured (e.g. 7x/x86_64/os),
dnf fails to load the repository with the following error:

  basic_string::_S_construct null not valid, ignoring this repo.

I tracked this down to these lines in libdnf (see
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rpm-2Dsoftware-2Dmanagement_libdnf_blob_ad6d26fb0b9c92838b98513be47c2837ca165ce7_libdnf_repo_Repo.cpp-23L1025&d=DwIBaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=gd8BzeSQcySVxr0gDWSEbBYBgsCHS7vSr83lHQ-aa58eXICk1KkzZlAHgohLRRrX&m=oV6hpXkb7j1aO27zXIgqbe1G5TT-orJBbynPDrTir4w&s=rOy-wFxOo11xo1NKNy5gv6hwcthwhz46XSDw6bhztxI&e= ):

  if (distroTag->tag)
    distro_tags.emplace_back(distroTag->cpeid, distroTag->tag);

The problem is that distroTag->tag is non-NULL, but distroTag->cpeid
*is* NULL. So this code tries to create a std::string from a NULL
pointer, which throws a C++ runtime_error exception.

These values originate from the repomd.xml file. The CentOS 8
repomd.xml has this <distro> tag (note "cpeid" attribute):

    <distro cpeid="cpe:/o:centos:centos:8">CentOS 8</distro>

The Centos 7 repomd.xml has no <distro> tag at all. Both of these
repositories work fine.

But SL7 has this <distro> tag (note missing "cpeid" attribute):

    <distro>cpe:/o:scientificlinux:scientificlinux:7.7:GA</distro>

Since the <distro> tag is present but the "cpeid" attribute is NULL,
the failure path in libdnf is triggered.

When I manually edit the SL7 repomd.xml to add "cpeid" attribute to
the <distro> tag, or when I simply remove the <distro> tag entirely,
dnf becomes happy with the repository.

Could you modify repomd.xml to make it compatible with dnf?

Thanks!

 - Pat