Bug 1421298 - File uploads via hammer do not work
Summary: File uploads via hammer do not work
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Eric Helms
QA Contact: Martin Bacovsky
Depends On:
TreeView+ depends on / blocked
Reported: 2017-02-10 22:47 UTC by Justin Sherrill
Modified: 2021-03-11 14:57 UTC (History)
22 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16429 0 Normal Closed Large files can't be uploaded through content upload APIs 2020-11-16 14:20:04 UTC
Foreman Issue Tracker 16457 0 Normal Closed Support large file uploads in the CLI 2020-11-16 14:19:44 UTC
Red Hat Knowledge Base (Solution) 3168121 0 None None None 2018-06-19 01:36:09 UTC

Description Justin Sherrill 2017-02-10 22:47:20 UTC
Description of problem:

Trying to upload a file via hammer to file repo does not work:

[root@sat-r220-09 ~]# hammer -u admin -p changeme repository upload-content --id=4639 --path=/etc/exports
Failed to upload file 'exports' to repository. Please check the file and try again.

Version-Release number of selected component (if applicable):

How reproducible:

Comment 1 Justin Sherrill 2017-02-10 22:50:04 UTC
Connecting redmine issue http://projects.theforeman.org/issues/16457 from this bug

Comment 2 Justin Sherrill 2017-02-10 22:52:45 UTC
Note, ive attached an upstream hammer issue to handle large file uploads, but it seems even small ones are not working.

Comment 3 pm-sat@redhat.com 2017-02-12 09:00:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16457 has been resolved.

Comment 4 Marek Hulan 2017-02-13 07:51:50 UTC
Justin, did the fix for large files helped? Is this specific to content part?

Comment 5 Justin Sherrill 2017-02-13 13:32:28 UTC
It didn't seem to help at all, i just linked it to this bz as i figured it may be part of the solution.  It seems like all file (what pulp calls iso) uploads aren't working for some reason, small or large.

Comment 6 Justin Sherrill 2017-02-13 14:19:25 UTC
Actually i was just missing a commit!  Added a second upstream issue that resolved the issue.

Comment 9 Konstantin Trufanov 2017-06-27 09:03:42 UTC
It seems that it fails with any filesize.

Comment 11 Martin Bacovsky 2017-08-02 14:17:46 UTC
Version Tested: Satellite-6.3 Snap 8

It is possible to upload files to file repo using hammer.

# ll -h Fedora-*
-rw-r--r--. 1 root root 951M Jul 23 18:56 Fedora-Atomic-ostree-x86_64-26-20170723.0.iso
-rw-r--r--. 1 root root  42M Jul  5 17:48 Fedora-Docker-Base-26-1.5.x86_64.tar.xz

# hammer repository info --id 1|grep Type
Content Type:       file

# hammer repository upload-content --organization-id 1 --id 1 --path Fedora-Atomic-ostree-x86_64-26-20170723.0.iso 
Successfully uploaded file 'Fedora-Atomic-ostree-x86_64-26-20170723.0.iso'.

# hammer repository upload-content --organization-id 1 --id 1 --path Fedora-Docker-Base-26-1.5.x86_64.tar.xz 
Successfully uploaded file 'Fedora-Docker-Base-26-1.5.x86_64.tar.xz'.

Both files are visible in the repo:

# lynx http://intel-lizardhead-02.lab.bos.redhat.com/pulp/isos/dccd28c2-0477-42bf-a675-d0b3cb83fe69/                                                                                      Index of /pulp/isos/dccd28c2-0477-42bf-a675-d0b3cb83fe69

   [ICO] Name Last modified Size Description

   [PARENTDIR] Parent Directory   -
   [ ] Fedora-Atomic-ostree-x86_64-26-20170723.0.iso 2017-08-02 09:45 951M
   [ ] Fedora-Docker-Base-26-1.5.x86_64.tar.xz 2017-08-02 09:35 42M
   [ ] PULP_MANIFEST 2017-08-02 09:45 237

# rpm -qa|grep -e ^satellite-[0-9] -e hammer_cli_katello

Comment 15 pm-sat@redhat.com 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> For information on the advisory, and where to find the updated files, follow the link below.
> If the solution does not work for you, open a new bug report.
> https://access.redhat.com/errata/RHSA-2018:0336

Note You need to log in before you can comment on or make changes to this bug.