Bug #37864
closedUpload deb package through hammer results in an invalid package being included when it's uploaded for the first time
Description
See: https://community.theforeman.org/t/upload-deb-package-through-hammer-results-in-empty-invalid-packages-in-repo/39628
Summary: When uploading a deb package using hammer, the first time the package is uploaded it will result in a successful upload but the repo contains an empty line. When refreshing from a debian host an error is generated that no package was found.
When uploading the same package again it will be shown as another line with the right name and version and does indeed work fine.
Subsequent uploads don't add extra packages which is expected and prefered behavior.
Quick way to test this bug out:
#!/bin/bash
curl --fail-with-body --output /tmp/vim_9.1.0496-1ubuntu5_amd64.deb "http://archive.ubuntu.com/ubuntu/pool/main/v/vim/vim_9.1.0496-1ubuntu5_amd64.deb"
hammer repository upload-content --path /tmp/vim_9.1.0496-1ubuntu5_amd64.deb --organization ORGNAME --product "product name" --name "Repo name"
read -p "Upload successful, please check the repo currently before doing the next upload"
hammer repository upload-content --path /tmp/vim_9.1.0496-1ubuntu5_amd64.deb --organization ORGNAME --product "product name" --name "Repo name"
read -p "Check the repo again, now there's a second entry which has the correct details and works"
rm /tmp/vim_9.1.0496-1ubuntu5_amd64.deb
I've chosen to put this on prioty low as uploading it a second time does push the package through. While this sadly generates a warning on the host that can reach the repository, it doesn't change the return code of the subscription-manager/apt.
Files
Updated by Macley kun about 1 month ago
Refering to this post aswell: https://community.theforeman.org/t/making-my-own-deb-package-resulsts-in-default-inrelease-doesnt-support-architecture-amd64/39835/6
It seems that packages that are uploaded through the API, can't be fetched from the hosts that want to query/install from the published repository.
A way to verify this behavior is by doing the following:
Create two custom repositories in foreman.
In one, upload a deb package through the UI.
in the other, upload the same deb package through the API.
After the CV is published, subscription-manager refresh and apt update on a ubuntu host.
The repository where a package was uploaded through the API returns:
N: Skipping acquire of configured file ‘all/binary-amd64/Packages’ as repository ‘katello://server.foreman.lan/pulp/deb/acme/Production/CV_UBUNTU_22-04/custom/Ubuntu_22-04/Today_I_Patched_Package default InRelease’ doesn’t support architecture ‘amd64’
When checking the packages list in: /var/lib/apt/lists
and catting the repositories named files, shows that only the UI variant has the package in it.
Updated by The Foreman Bot 6 days ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11221 added
Updated by Markus Bucher 5 days ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|05f3fc98c0283f41f51edfc8075496e19bbc45ab.
Updated by Markus Bucher 3 days ago
- Related to Bug #38035: Upload deb package through hammer may not add it publication added