[Katello 2.4] hammer repository upload failed but package shows up in repo

Hi all,
I've googled for similar issues in the forum and didn't see anyone with
anything similar so I figured I'd make a thread since this is biting us
pretty regularly.

I run this command:
[root@katello bob]# hammer repository upload-content --name
ACMESoftware_CentOS_7.1 --product ACMESoftware --organization ACME --path
/acme/storage/RPMS/package-3.5.0-7.x86_64.rpm
Failed to upload file 'package-3.5.0-7.x86_64.rpm' to repository. Please
check the file and try again.

Then when I look in the repo for that product in the GUI the package would
show up in the repo.

If I upload the package again I end up with two copies of the package in
the repo… which causes problems. We get this error intermittently but
enough for us to have multiple copies of bad files in the repo.
It seems to me that if the command errors out cleanup should be done for
the metadata and any parts of the process that completed successfully
before the error erased.

katello-2.4.1-1.el7.noarch
centos-7.2

Hi there Edson,

This should fix your hammer issue, if you are comfortable with editing the
code: https://github.com/Katello/katello/pull/6047. You should be able to
find this file at
/opt/theforeman/tfm/root/usr/share/gems/gems/<your-version-of-katello>/app/controllers/katello/api/v2/content_uploads_controller.rb

I hope this helps, and let us know how it goes!

··· On Thu, May 19, 2016 at 1:24 PM, Edson Manners wrote:

Hi all,
I’ve googled for similar issues in the forum and didn’t see anyone with
anything similar so I figured I’d make a thread since this is biting us
pretty regularly.

I run this command:
[root@katello bob]# hammer repository upload-content --name
ACMESoftware_CentOS_7.1 --product ACMESoftware --organization ACME --path
/acme/storage/RPMS/package-3.5.0-7.x86_64.rpm
Failed to upload file ‘package-3.5.0-7.x86_64.rpm’ to repository. Please
check the file and try again.

Then when I look in the repo for that product in the GUI the package would
show up in the repo.

If I upload the package again I end up with two copies of the package in
the repo… which causes problems. We get this error intermittently but
enough for us to have multiple copies of bad files in the repo.
It seems to me that if the command errors out cleanup should be done for
the metadata and any parts of the process that completed successfully
before the error erased.

katello-2.4.1-1.el7.noarch
centos-7.2


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.