It seems magento creates http headers that are too long for most or some apache configurations. For me it happens when visiting a category page with many products.
PHP error log:
[Fri Feb 21 09:20:55.678915 2020] [proxy_fcgi:error] [pid 13470:tid 140320488904448] [client XXXXX:53641] Premature end of script headers: index.php, referer: https://XXXXX/shop/catalog/category/view/id/3
[Fri Feb 21 09:20:55.678978 2020] [proxy_fcgi:error] [pid 13470:tid 140320488904448] [client XXXXX:53641] AH01070: Error parsing script headers, referer: https://XXXXX/shop/catalog/category/view/id/3
[Fri Feb 21 09:20:55.678984 2020] [proxy_fcgi:error] [pid 13470:tid 140320488904448] (22)Invalid argument: [client XXXXX:53641] AH01075: Error dispatching request to : , referer: https://XXXXX...
I can understand that these headers are important for caching, and the HTTP spec doesnt define a limit for header sizes.
But most servers do in fact implement a limit (around ~8k), so i think this is a bug that should be fixed. https://stackoverflow.com/questions/686217/maximum-on-http-header-values
In my specific case, the http response is cached by magento FPC, and returned to the client in:
magento/vendor/magento/framework/App/Http.php:122
The X-Magento-Tags heade size is 27kB. The content is made up of strings like this one: cat_p_2611,cat_p,cat_p_2584,cat_p_2585.
If i add the following in the row after, the page works again:
$this->_response->setHeader('X-Magento-Tags', "test");
Hi @marvinhinz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@marvinhinz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
This is strongly related to https://github.com/magento/magento2/issues/6401 and is probably a duplicate.
But I'll leave this ticket open for now, since it needs to be more in the spotlight and needs to get fixed sooner rather than later.
I also faced the same issue and its due to long headers...
I can confirm, this can still be an issue with Magento 2.4.0
Hi @ihor-sviziev. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop branchDetails
- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Add label Issue: Confirmed once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @marvinhinz,
Seems like issue was already fixed in #6401 and was already fixed in Magento 2.4.1.
Could you confirm that?
I can reproduce this in 2.3.5-p1
In order to have fully functional fix for all cases - we should introduce some tags splitting mechanism. There was one trial to do that in https://github.com/magento/magento2/pull/12831, but it wasn't finalized.
If someone interested in fixing this issue - please create PR with the same changes + fix the all requested changes in https://github.com/magento/magento2/pull/12831#pullrequestreview-128271255
Most helpful comment
This is strongly related to https://github.com/magento/magento2/issues/6401 and is probably a duplicate.
But I'll leave this ticket open for now, since it needs to be more in the spotlight and needs to get fixed sooner rather than later.