Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsFooterPlugin sets Http Response content empty if PCRE limit reached #26026

Closed
cundd opened this issue Dec 13, 2019 · 8 comments · Fixed by #27270
Closed

JsFooterPlugin sets Http Response content empty if PCRE limit reached #26026

cundd opened this issue Dec 13, 2019 · 8 comments · Fixed by #27270
Assignees
Labels
Component: HTTP Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers

Comments

@cundd
Copy link

cundd commented Dec 13, 2019

Preconditions (*)

  1. Magento 2.3.2-p2
  2. PHP 7.1
  3. pcre.backtrack_limit = 1000000 (Default)
  4. pcre.recursion_limit = 1000000 (Default)
  5. dev/js/move_script_to_bottom=enabled

Steps to reproduce (*)

  1. Build a huge HTML output (e.g. shopping cart with a lot of complex products)

Expected result (*)

  1. Output should be turned or error should be thrown

Actual result (*)

  1. A HTTP status code 200 without a response body is returned

The call to preg_replace_callback() in JsFooterPlugin will fail silently, resulting in a blank page. The reason for this is, that preg_replace_callback() will return NULL if one of it's limits is reached. NULL will further be used to set the content of the HTTP response.

A first step would be to check if the result of preg_replace_callback() is NULL and throw an appropriate exception (generated from preg_last_error()).

@m2-assistant
Copy link

m2-assistant bot commented Dec 13, 2019

Hi @cundd. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.

@cundd do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 13, 2019
@cundd
Copy link
Author

cundd commented Dec 13, 2019

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @cundd. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @cundd, here is your Magento instance.
Admin access: https://i-26026-2-4-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@cundd
Copy link
Author

cundd commented Dec 13, 2019

I couldn't manage to reproduce it with the admin access only, but fixing this would more be a general improvement to the Magento framework, rather than an immediate fix for a bug.

@engcom-Echo engcom-Echo self-assigned this Dec 13, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 13, 2019

Hi @engcom-Echo. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label 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 branch

    Details- 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.

@engcom-Echo engcom-Echo added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: HTTP Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 13, 2019
@ghost ghost unassigned engcom-Echo Dec 13, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Echo
Thank you for verifying the issue. Based on the provided information internal tickets MC-29768 were created

Issue Available: @engcom-Echo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 13, 2019
@magento-engcom-team magento-engcom-team added this to Ready for Dev in Community Backlog Mar 24, 2020
@ghost ghost assigned krzksz Apr 4, 2020
@ghost ghost moved this from Ready for Dev to PR In Progress in Community Backlog Apr 4, 2020
@ghost ghost added Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Apr 24, 2020
@slavvka slavvka linked a pull request Apr 24, 2020 that will close this issue
4 tasks
@sdzhepa sdzhepa added the Triage: Done Has been reviewed and prioritized during Triage with Product Managers label May 6, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label May 19, 2020
@ghost ghost moved this from PR In Progress to Done (last 30 days) in Community Backlog May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: HTTP Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants