Project

General

Profile

Actions

Bug #24249

closed

hammer repository upload-content fails when uploading larger files

Added by Ivan Necas over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1600906

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.

Actions

Also available in: Atom PDF