Issue #9463
closedThe chunked upload test fails in the dev environment
Description
The chunked upload test in pulpcore/tests/functional/api/test_upload.py
fails on the dev environment or when the test is run against a pulp server using nginx. This is because the max request size by default in nginx is 1M.
________________________________________________________________ ChunkedUploadTestCase.test_create_artifact_passing_checksum _________________________________________________________________
self = <pulpcore.tests.functional.api.test_upload.ChunkedUploadTestCase testMethod=test_create_artifact_passing_checksum>
def test_create_artifact_passing_checksum(self):
"""Test creation of artifact using upload of files in chunks passing checksum."""
upload_request = self.client.post(UPLOAD_PATH, {"size": self.size_file})
for data in self.chunked_data:
import pdb; pdb.set_trace()
> self.client.put(
upload_request["pulp_href"],
data={"sha256": hashlib.sha256(data[0]).hexdigest()},
files={"file": data[0]},
headers=data[1],
)
pulpcore/tests/functional/api/test_upload.py:78:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../pulp-smash/pulp_smash/api.py:597: in put
return self.request("PUT", url, **kwargs)
../pulp-smash/pulp_smash/api.py:629: in request
response = self.response_handler(self, requests.request(method, **request_kwargs))
../pulp-smash/pulp_smash/api.py:284: in smart_handler
response = safe_handler(client, response)
../pulp-smash/pulp_smash/api.py:148: in safe_handler
response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [413]>
def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
reason = self.reason.decode('iso-8859-1')
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
elif 500 <= self.status_code < 600:
http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 413 Client Error: Request Entity Too Large for url: http://pulp3-source-fedora.crake.example.com:80/pulp/api/v3/uploads/a222e7e9-2e4e-4119-8d7a-d54
2a319624c/
/usr/local/lib/pulp/lib64/python3.9/site-packages/requests/models.py:943: HTTPError
Updated by daviddavis about 3 years ago
- Status changed from ASSIGNED to POST
Updated by daviddavis about 3 years ago
Looks like the test passes in the CI because the CI container sets the request limit size to 10m:
Updated by daviddavis about 3 years ago
- Category set to Installer - Moved to GitHub issues
- Status changed from POST to NEW
- Assignee deleted (
daviddavis) - Sprint deleted (
Sprint 106)
It looks like updating the fixture to use a smaller size is incredibly painful. It breaks a number of tests and we'd have to backport these fixes to numerous older release branches.
I think perhaps the best way to fix this is to update the dev environment to raise the client_max_body_size
to 10m?
Updated by fao89 about 3 years ago
you can set pulp_client_max_body_size: https://docs.pulpproject.org/pulp_installer/roles/pulp_webserver/
Updated by daviddavis about 3 years ago
Nice, I wonder if we could/should default it to 10m for dev environments?
Updated by fao89 about 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to fao89
- Tags Dev Environment added
Added by Fabricio Aguiar about 3 years ago
Added by Fabricio Aguiar about 3 years ago
Revision 34d25453 | View on GitHub
Set client_max_body_size
to 10m for dev environments
closes #9463
Updated by pulpbot about 3 years ago
- Status changed from ASSIGNED to POST
Updated by Anonymous about 3 years ago
- Status changed from POST to MODIFIED
Applied in changeset ansible-pulp|34d254533abeb96555f16231165eb22d0a5afdcf.
Updated by pulpbot about 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Set
client_max_body_size
to 10m for dev environmentscloses #9463