Bug 1600906

Summary: hammer repository upload-content fails when uploading larger files
Product: Red Hat Satellite Reporter: Ivan Necas <inecas>
Component: RepositoriesAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: pcreech, ptrivedi, sjagtap
Target Milestone: 6.4.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:20:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1572297, 1582318    

Description Ivan Necas 2018-07-13 10:44:32 UTC
Description of problem:

hammer repository upload-content fails when uploading larger files

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

How reproducible:
always

Steps to Reproduce:
1. have a larger file (10MB+)
2. hammer repository upload-content --name image --product RHVH --organization "Default Organization" --path myfile.img 

Actual results:
warning: Overriding "Content-Type" header "multipart/form-data" with "multipart/form-data; boundary=----RubyFormBoundaryueJ8T7XEKh2BLjan" due to payload
Failed to upload file 'squashfs-1.img' to repository. Please check the file and try again.

Expected results:
Successfully uploaded file 'myfile.img'

Additional info:

Pulp produced this error message:

Jul 12 16:20:03 sat-6-4-qa-rhel7 pulp: pulp.server.webservices.middleware.exception:ERROR: Unhandled Exception
Jul 12 16:20:03 sat-6-4-qa-rhel7 pulp: pulp.server.webservices.middleware.exception:ERROR: (1125-57920) Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Jul 12 16:20:03 sat-6-4-qa-rhel7 pulp: pulp.server.webservices.middleware.exception:ERROR: (1125-57920) Traceback (most recent call last):
Jul 12 16:20:03 sat-6-4-qa-rhel7 pulp: pulp.server.webservices.middleware.exception:ERROR: (1125-57920)   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
Jul 12 16:20:03 sat-6-4-qa-rhel7 pulp: pulp.server.webservices.middleware.exception:ERROR: (1125-57920)     response = wrapped_callback(request, *callback_args, **callback_kwargs)

Seems like the limit on the maximum file size changed between django releases, currently limiting the size to something around 2.5 MB:

cat /usr/lib/python2.7/site-packages/django/conf/global_settings.py | grep DATA_UPLOAD_MAX_MEMORY_SIZE
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440  # i.e. 2.5 MB

We need to update hammer to conform to this size (the chunk size there is 4 000 000 bytes at the moment.

Additional issue is the warning: Overriding "Content-Type" header "multipart/form-data" with "multipart/form-data; boundary=----RubyFormBoundaryueJ8T7XEKh2BLjan" due to payload - this seems to be an issue in rest-client: until it's fixed properly in there, we should suppress the warning, which is very confusing to the user.

Comment 2 Ivan Necas 2018-07-13 10:54:16 UTC
Created redmine issue https://projects.theforeman.org/issues/24249 from this bug

Comment 4 Satellite Program 2018-07-17 14:01:51 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/24249 has been resolved.

Comment 5 Sanket Jagtap 2018-07-24 06:55:45 UTC
Build :Satellite 6.3.0 snap13

[root@qe-testing-rhel7 ~]# hammer repository upload-content --name "$REPO" --product "$PRODUCT" --organization "$ORG" --path "$IMG_PATH"
Successfully uploaded file 'squashfs.img'

hammer> repository info --id 7 --organization-id 1
ID:                 7
Name:               image
Label:              image
Organization:       Default Organization
Red Hat Repository: no
Content Type:       file
Mirror on Sync:     yes
URL:                
Publish Via HTTP:   yes
Published At:       http://sat-host/pulp/isos/Default_Organization/Library/custom/RHVH/image/
Relative Path:      Default_Organization/Library/custom/RHVH/image
Product:            
    ID:   40
    Name: RHVH
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2018/07/24 05:57:18
Updated:            2018/07/24 05:57:20
Content Counts:     
    Files: 1

Comment 6 Bryan Kearney 2018-10-16 19:20:13 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:2927