Private mirror of SCM-Manager yum repo

Hi, for some servers not connected to the internet we’re trying to use the Red Hat Satellite system to mirror the SCM-manager yum repository. However, it seems like the user agent for the Satellite is being refused.

The satellite is configured to sync with the URL at https://packages.scm-manager.org/repository/yum-v2-releases/
But it appears to receive a bogus response. Is it possible to connect the repository to a Satellite system somehow?

Hey,

we do not use Red Hat Satellite and therefore don’t know how to configure it properly.

The repository which you are trying to sync is hosted on a Sonatype Nexus OSS 3.42.0-01. We could not find any connection errors in today’s log files of our Nexus. I would guess that the error is either from a misconfiguration of your Satellite or even an incompatibility between the two systems.

Could you share your actual error or the response?

Regards, Eduard

Hi Eduard,

I’m afraid the errors aren’t of much help. To put it bluntly, you can enter the yum repo baseurl with some optional parameters into a Red Hat Satellite product and set it to synchronize the packages from the remote repository.

The logs indicate the following error:

pulp: celery.worker.strategy:INFO: Received task: pulp.server.managers.repo.sync.sync[17cb4d54-cb5e-4b44-85d9-107327b8bfef]
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Downloading metadata from https://packages.scm-manager.org/repository/yum-v2-releases/.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Parsing metadata.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Downloading metadata from https://packages.scm-manager.org/repository/yum-v2-releases/.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Parsing metadata.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Downloading metadata from https://packages.scm-manager.org/repository/yum-v2-releases/.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Parsing metadata.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Downloading metadata from https://packages.scm-manager.org/repository/yum-v2-releases/.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Parsing metadata.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Downloading metadata files.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Generating metadata databases.
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: [17cb4d54] Determining which units need to be downloaded.
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104) field must be a non-empty string
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104) Traceback (most recent call last):
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 294, in run
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     self.update_content(metadata_files, url)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 606, in update_content
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     rpms_to_download, drpms_to_download = self._decide_what_to_download(metadata_files, catalog)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 645, in _decide_what_to_download
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     self._decide_rpms_to_download(metadata_files, catalog)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 682, in _decide_rpms_to_download
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     wanted, primary_rpm_count = self._identify_wanted_versions(package_info_generator)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 1114, in _identify_wanted_versions
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     serialized_version = model.complete_version_serialized
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 210, in complete_version_serialized
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     return tuple(version_utils.encode(field) for field in self.complete_version)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 210, in <genexpr>
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     return tuple(version_utils.encode(field) for field in self.complete_version)
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)   File "/usr/lib/python2.7/site-packages/pulp_rpm/common/version_utils.py", line 80, in encode
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104)     raise ValueError('field must be a non-empty string')
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [17cb4d54] (7236-71104) ValueError: field must be a non-empty string
pulp: pulp.server.async.tasks:INFO: [17cb4d54] Task failed : [17cb4d54-cb5e-4b44-85d9-107327b8bfef]

Function being called that’s throwing the error is:

def encode(field):
    """
    Translates a package version into a string representation that is sortable according
    to the rules for RPM versions.

    :param field: version or release string to encode
    :type  field: str

    :return: encoded value that should be used for comparison searches and sorting
    """
    if not isinstance(field, basestring):
        raise TypeError('field must be a non-empty string')

    if len(field) == 0:
        raise ValueError('field must be a non-empty string')

    try:
        all_segments = reduce(_split_segments, field).split('.')
        encoded_segments = map(_encode_segment, all_segments)
        encoded_field = '.'.join(encoded_segments)
    except TooManyDigits:
        raise ValueError('Cannot not encode %s; too many digits in the field' % field)

    return encoded_field

However I cannot extract the exact call the software makes or the response it receives. The error indicates something wrong with the package versioning, however if I browse the repository it seems fine according to the Fedora Versioning Guidelines.

This yum repository contains two types of artifacts. The actual scm server and also our cli package. Maybe the versioning of the cli packages breaks the version resolution? Can you filter that you only want to sync packages starting with scm-server?

Screenshot from 2023-02-24 10-20-17

I’m afraid filtering before the sync isn’t an option yet, only afterwards, but we never get there of course. I see there’s a feature request open for this functionality but it’s not gained much traction.

Thanks for the information so far, I’m going to consider my options and discuss with the team here how we can proceed.