Magento2: Saving product results: "Request entity too large"

Created on 16 Aug 2017  路  4Comments  路  Source: magento/magento2

Preconditions

  1. Magento 2.1.7
  2. PHP 7.0.18
  3. MySQL 5.0.12
  4. max_input_vars = 50 000
  5. post_max_size = 256M
  6. memory_limit = 768M

Steps to reproduce

  1. We have a bundle product with a lot of attributes and bundle items.
  2. Open product details and save product.

Expected result

  1. Product data should be saved.

Actual result

  1. Error page is shown:

Request Entity Too Large

The requested resource
/catalog/product/save/id/1235/type/bundle/store/0/set/12/key/2a98afc9e64adbd313c5e6dfbe0c5d1d9ff814d35123ksadc5f3ba3f6ac7a6b123/back/edit
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

We also have a development shop on the same server that we duplicated from production and there we do not have this issue.

Most helpful comment

For Nginx you can check client_max_body_size as well, the default is 1m so things like file uploads can easily go over that.

https://nginx.org/en/docs/http/ngx_http_core_module.html

All 4 comments

https://stackoverflow.com/questions/8896644/request-entity-too-large, https://stackoverflow.com/questions/18121227/how-to-avoid-request-entity-too-large-413-error contain a bunch of recipes for different situations, like if you use nginx or Apache mod_ssl.

Your question should have been posted on Magento Stack Exchange as well.

We also have a development shop on the same server that we duplicated from production and there we do not have this issue.

This obviously indicates problem is with server configuration identical Magento code is used. Try to compare all the php.ini settings.

For Nginx you can check client_max_body_size as well, the default is 1m so things like file uploads can easily go over that.

https://nginx.org/en/docs/http/ngx_http_core_module.html

Solution was to increase SSLRenegBufferSize setting on server.

If you are running mod security and you run into the 413 error it could also be these settings in mod security.conf:

SecRequestBodyLimit 1024
SecRequestBodyNoFilesLimit 1024

Was this page helpful?
0 / 5 - 0 ratings