I have custom cron, which initially had an error:

Please set a website ID.

I got rid of this issue by doing below:

$this->emulation->startEnvironmentEmulation($store_id, \Magento\Framework\App\Area::AREA_FRONTEND, true);

//my code


Then after some time on the server, I had an error:

Process went away at 2020-02-09 12:19:06 (supposed time)

This issue was solved by simply removing the above emulation code which I added to solve the

Please set a website ID.

error and it was working again fine for some time.

Now I am again getting the same error

Please set a website ID.

Please tell me what is actually wrong?


Please ensure that $store_id is right.

The store id which you provide is not right. that why it is happening.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.