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