Inconsistency in URL Generation for RPMs with Epochs in Pulp/Foreman

We’ve encountered an inconsistency in the way Pulp or Foreman handles URLs for RPM packages with epochs greater than 0.

The Issue:

  • When uploading an RPM with an epoch (e.g., container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm, epoch: 2), the generated URL in Pulp/Foreman excludes the epoch information:
    • Actual URL: <BASE_URL>/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
  • However, the expected behavior, and how yum would access the package, is to include the encoded epoch:
    • Expected URL: <BASE_URL>/container-selinux-2%3A2.119.2-1.911c772.el7_8.noarch.rpm (“:2” encoded as “%3A”)

Consequences:
This discrepancy leads to package resolution issues, as package managers like yum rely on the epoch for accurate identification. and showing 404 not found

The Question:
Is there a configuration option in Pulp or Foreman to ensure generated URLs for
RPMs with epochs greater than 0 include the encoded epoch information in the url
link to the rpm resource for proper package resolution?

Hi @ybenzaid

I have tried to reproduce this issue on Foreman 3.9/Katello 4.11/Pulp 3.39 but can’t.

Do you have an upstream URL as reproducer? I used createrepo_c (no epoch aka 0) and xorg-x11-xauth (epoch 1) on/from AlmaLinux 8.10. URLs for Library and a published CV version look sane to me.

Hi @maximilian

I am using Centos7.9 (Foreman 3.3/Katello 4.5/Pulp 3.18).
For example, even using the following as the upstream URL:
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
I get issues with epoch on certain rpms.

Retested with Yum repository https://download.docker.com/linux/centos/7/x86_64/stable/:

# cat /etc/yum.repos.d/test.repo
[test]
name=test
baseurl=https://foreman-katello.example.com/pulp/content/Example/Library/custom/maximilian-test-epoch/docker_el7/
enabled=1
gpgcheck=0
sslverify=0

# dnf info docker-ce-cli
Name         : docker-ce-cli
Epoch        : 1
Version      : 26.1.4
Release      : 1.el7
...

# dnf install docker-ce-cli
...
Installing:
 docker-ce-cli                                              x86_64                                      1:26.1.4-1.el7                                        test                                       15 M
Installing dependencies:
 docker-buildx-plugin                                       x86_64                                      0.14.1-1.el7                                          test                                       14 M
 docker-compose-plugin                                      x86_64                                      2.27.1-1.el7                                          test                                       13 M
...

docker-ce-cli in a published CV also shows the epoch in WebUI correctly.

Retested with versioned content from a content view version also correctly shows the epoch:

  • Yum repo baseurl: https://foreman-katello.example.com/pulp/content/Example/content_views/maximilian-test-epoch/1.0/custom/maximilian-test-epoch/docker_el7/
  • dnf install docker-ce-cli: docker-ce-cli x86_64 1:26.1.4-1.el7 test 15 M

I cannot reproduce this on Foreman 3.9, so I suggest that you upgrade and retest this.