Skip to content

api.server: Fix client_max_size parameter transmission to aiohttp

Since a recent refactoring, the client_max_size config value was no more transmitted to the aiohttp.web.Application instance.

This was resulting in errors when a cooked archive had a size greater than 1048576 bytes, see stack trace observed when playing with the vault in docker-compose environment below:

swh-vault-worker_1            | [2019-04-26 13:05:13,855: INFO/MainProcess] Connected to amqp://guest:**@amqp:5672//
swh-vault-worker_1            | [2019-04-26 13:05:13,988: INFO/MainProcess] vault@2713bd8ecd80 ready.
swh-vault-worker_1            | [2019-04-26 13:11:42,416: INFO/MainProcess] Received task: swh.vault.cooking_tasks.SWHCookingTask[2cf11e3e-1005-428e-8c1d-0d181c3f2623]  
swh-vault-worker_1            | [2019-04-26 13:11:42,455: INFO/ForkPoolWorker-1] Loading config file /cooker.yml
swh-vault-worker_1            | [2019-04-26 13:19:21,483: ERROR/ForkPoolWorker-1] Bundle cooking failed.
swh-vault-worker_1            | Traceback (most recent call last):
swh-vault-worker_1            |   File "/srv/softwareheritage/venv/lib/python3.6/site-packages/swh/vault/cookers/base.py", line 122, in cook
swh-vault-worker_1            |     self.backend.put_bundle(self.CACHE_TYPE_KEY, self.obj_id, bundle)
swh-vault-worker_1            |   File "/srv/softwareheritage/venv/lib/python3.6/site-packages/swh/vault/api/client.py", line 45, in put_bundle
swh-vault-worker_1            |     data=bundle)
swh-vault-worker_1            |   File "/srv/softwareheritage/venv/lib/python3.6/site-packages/swh/core/api/__init__.py", line 198, in post
swh-vault-worker_1            |     return self._decode_response(response)
swh-vault-worker_1            |   File "/srv/softwareheritage/venv/lib/python3.6/site-packages/swh/core/api/__init__.py", line 235, in _decode_response
swh-vault-worker_1            |     response.content,
swh-vault-worker_1            | swh.core.api.RemoteException: Unexpected status code for API request: 413 (b'Maximum request body size 1048576 exceeded, actual body size 1272960')

Migrated from D1435 (view on Phabricator)

Merge request reports