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

Magento 2.4.x error "Environment emulation nesting is not allowed" occurs while sending invoice email #36134

Open
5 tasks
khoailangthang-programing opened this issue Sep 13, 2022 · 8 comments
Labels
Area: Admin UI Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@khoailangthang-programing
Copy link

Preconditions and environment

  • Magento 2.4.x CE

Steps to reproduce

  1. Create order
  2. Go Backend > Sales > Orders
  3. Create Invoice
  4. Send Email invoice
  5. Check system.log

Expected result

Invoice send to customer without error

Actual result

system.log logged the error: Environment emulation nesting is not allowed.

The reason is \Magento\Sales\Model\Order\Email\Sender\InvoiceSender::send calls \Magento\Payment\Helper\Data::getInfoBlockHtml into (startEnvironmentEmulation and stopEnvironmentEmulation) scope. and \Magento\Payment\Helper\Data::getInfoBlockHtml is also declared (startEnvironmentEmulation and stopEnvironmentEmulation).

https://imgur.com/0YvQX4E
https://imgur.com/Wd3AUhQ

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Sep 13, 2022

Hi @psydog-1101. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

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

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Sep 13, 2022
@engcom-Hotel engcom-Hotel added the Reported on 2.4.x Indicates original Magento version for the Issue report. label Sep 13, 2022
@engcom-Delta engcom-Delta self-assigned this Sep 13, 2022
@m2-assistant
Copy link

m2-assistant bot commented Sep 13, 2022

Hi @engcom-Delta. 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-Delta
Copy link
Contributor

✔️ Issue confirmed

Issue got reproduced in 2.4-develop branch.

Description:

While sending the invoice mail , mail was sent and an error is showing in the system.log file.

Pre-requisite:

  1. Magento 2.4.x CE

Steps to reproduce:

  1. Create a order from frontend
  2. Create a invoice for the order
  3. Send the mail from invoice
  4. Checked in system.log file

Expected result:

Invoice send to customer without error

Actual result:

In system.log file error is generated.

Screenshots:

  1. Create a order from frontend

Screenshot 2022-09-14 at 10 45 37 AM

  1. Create a invoice for the order

Screenshot 2022-09-14 at 10 47 16 AM

  1. Send the mail from invoice

Screenshot 2022-09-14 at 10 48 54 AM

  1. Checked in system.log file

Screenshot 2022-09-14 at 10 49 53 AM

Hence, confirming the issue.
Thanks.

@engcom-Delta engcom-Delta added Area: Admin UI Component: Email 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 Sep 20, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Sep 20, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-6721 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Sep 20, 2022

✅ Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Hotel engcom-Hotel added the Priority: P3 May be fixed according to the position in the backlog. label Sep 20, 2022
@m2-community-project m2-community-project bot added this to Ready for Development in Low Priority Backlog Sep 20, 2022
@hostep
Copy link
Contributor

hostep commented Apr 11, 2023

This is probably a duplicate of #35603 which got fixed in the meanwhile, so this issue can probably be closed?

@thomas-kl1
Copy link
Member

I'm still experiencing this issue, I need to dig a bit deeper to confirm.

@Mordreak
Copy link

Feels like it should be fixed in the 2.4.7 release, but I'm also still experiencing this issue on 2.4.6-p5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Low Priority Backlog
  
Ready for Development
Development

No branches or pull requests

7 participants