RPM Package - Epochs break repo entry #14302

Closed
opened 2025-11-02 11:09:15 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @jahn-swob on GitHub (Mar 25, 2025).

Description

Uploading an RPM file with an epoch greater than 0 causes the upload to make a mal-formed rpm entry.
Looking through the database it appears that the [package_version].version entries have the epoch prefixed in the version erroneously and the [package_file].name also has the epoch prefixed before the version number.

Manually fixing these entries in the database fixes the expected URL that dnf needs to download the package, but since the file name was changed the signature is invalid.

This only affects the functionality within dnf - the packages within the listing in gitea will still allow manual downloading of the file.

Steps to reproduce:

  • Get docker-ce rpm (tested version was 3:28.0.2-1.el9 -- filename docker-ce-28.0.2-1.el9.x86_64.rpm)
  • Attempt to upload the rpm to a repository
    • Notice that:
      • Version number has been changed from 28.0.2-1.el9 to 3-28.0.2-1.el9
      • File name has been changed from docker-ce-28.0.2-1.el9.x86_64.rpm => docker-ce-3-28.0.2-1.el9.x86_64.rpm
  • Replicated here: https://demo.gitea.com/jahn-swob/-/packages/rpm/docker-ce/3-28.0.2-1.el9

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

RHEL9

How are you running Gitea?

Using the 1.23.3 release from go-gitea releases.
Replicated using demo.gitea.com

Database

MSSQL

Originally created by @jahn-swob on GitHub (Mar 25, 2025). ### Description Uploading an RPM file with an `epoch` greater than `0` causes the upload to make a mal-formed rpm entry. Looking through the database it appears that the `[package_version].version` entries have the `epoch` prefixed in the version erroneously and the `[package_file].name` also has the `epoch` prefixed before the version number. Manually fixing these entries in the database fixes the expected URL that `dnf` needs to download the package, but since the file name was changed the signature is invalid. This only affects the functionality within `dnf` - the packages within the listing in `gitea` will still allow manual downloading of the file. Steps to reproduce: - Get `docker-ce` rpm (tested version was `3:28.0.2-1.el9` -- filename `docker-ce-28.0.2-1.el9.x86_64.rpm`) - Attempt to upload the rpm to a repository - Notice that: - Version number has been changed from `28.0.2-1.el9` to `3-28.0.2-1.el9` - File name has been changed from `docker-ce-28.0.2-1.el9.x86_64.rpm` => `docker-ce-3-28.0.2-1.el9.x86_64.rpm` - Replicated here: https://demo.gitea.com/jahn-swob/-/packages/rpm/docker-ce/3-28.0.2-1.el9 ### Gitea Version 1.23.3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System RHEL9 ### How are you running Gitea? Using the 1.23.3 release from `go-gitea` releases. Replicated using `demo.gitea.com` ### Database MSSQL
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 11:09:15 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Apr 3, 2025):

Fixed with #34112. You need to re-generate the RPM repository metadata files by pushing a random package.

@KN4CK3R commented on GitHub (Apr 3, 2025): Fixed with #34112. You need to re-generate the RPM repository metadata files by pushing a random package.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14302