Skip to content

Broken repo mirroring for RPM with v17.7.0

Summary

When syncing a local repo mirror for RPM packages using dnf reposync since runner v17.7.0 has been published, the following error appears:

Error: Download target '/mirrorpath_replaced/noarch/gitlab-runner-helper-images-17.7.0-1.noarch.rpm' is outside of download path '/mirrorpath_replaced/runner_gitlab-runner'.

Playing around with options of dnf reposync using dnf reposync --help and man dnf reposync didn't help, the error kept appearing.

Steps to reproduce

Set up DNF repo and start mirroring using the command dnf reposync --repoid=runner_gitlab-runner --p /mirrorpath_replaced --delete --download-metadata --remote-time. We were able to reproduce these issues on RHEL 8 and RHEL 9.

Actual behavior

Everytime dnf reposync for the Gitlab runner runs, we get the error: Error: Download target '/mirrorpath_replaced/noarch/gitlab-runner-helper-images-17.7.0-1.noarch.rpm' is outside of download path '/mirrorpath_replaced/runner_gitlab-runner'.

Everytime we do dnf update on a machine using that mirrored repo, we get 404 errors for the new dependency gitlab-runner-helper-images-17.7.0-1.noarch.rpm. Updating the system doesn't work without excluding the Gitlab runner packages or repo.

Expected behavior

dnf reposync should simply sync the mirrored repo with its upstream official counterpart without any error.

Relevant logs and/or screenshots

Keep in mind the error stems from the new separated package `gitlab-runner-helper-images` being marked as `noarch` and linked in such a way so that package tries to escape the actual repo directory.
- /mirrorpath_replaced        <-- This is the whole path to the repo as set in dnf reposync's variable 'download_path'
    - /runner_gitlab-runner   <-- This is where the whole repo belongs, dnf reposync option --norepopath "skips" this directory and uses the download_path directly
    - /noarch                 <-- This is the directory the package erroneously tries to use. With --norepopath, dnf reposync tries to use such a directory on the level above download_path

Environment description

We host Gitlab on our own server and run Gitlab runner on multiple servers. The official Gitlab runner repo is being mirrored for local installations. The affected OSs are RHEL 8 and 9.

Used GitLab Runner version

Gitlab runner v17.7.0. Relates to #28014 (closed).

Possible fixes

Fix the repo setup/structure for the new package gitlab-runner-helper-images to stay inside the repo's directory.