Skip to main content
General

Magento 2 – sitemap generation error – Environment emulation nesting is not allowed

By January 9, 2019No Comments

After upgrading to Magento 2.3.0 a client flagged up an issue with the sitemap.xml. It was no longer automatically regenerating overnight.

Further inspection showed that there were some cron issues, although even after installing https://github.com/kiwicommerce/magento2-cron-scheduler , I couldn’t understand why the sitemap_generate cron was failing to run.

system > Cron Scheduler
#10841 – sitemap_generate
ERROR – Error when running a cron job – Jan 8, 2019 1:54:10 AM

I then tried to manually update the sitemap;
Marketing > Site map

and found this in the system.log;
[2019-01-09 15:31:57] main.ERROR: Environment emulation nesting is not allowed. [] []

Environment emulation nesting is not allowed

Magento 2 : Sitemap Generation Settings

Unlike the screengrab, clicking generate always errored, taking me to a blank page and a system.log error. A bit of Googling seemed to connect this with email templates more than sitemap generation, but after looking again at Magento’s generation settings within admin, I found the answer.

How to fix the sitemap generation error – Environment emulation nesting is not allowed

Error email recipient

Magento 2 : Error Email Recipient

I removed the error email recipient functionality and the manual regeneration link now works!

Fingers crossed Magento’s cron task list will also now complete without errors.

I’m not sure if this is a bug specific to Magento 2.3.0, so please do let me know if you experience the same issue.

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.