i have a problem with Bulk update in Magento 2.4.3.
if I make a bulk edit of some products I get the message:
Message is added to queque
but a second later this error appears:
Task "Update attributes for 2 selected products" : 1 item(s) failed to update"
and I also have a problem when I launch from the command line the following instruction:
php bin/magento cron:run
this is the error:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /generated/metadata/global.php on line 236136
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /generated/metadata/global.php on line 236136
Ran jobs by schedule.
but i have set memory limit to -1
How can I solve it?
3
Answers
I solved it by deleting the cron tasks from the database and then instead of launching the
php bin/magento cron:run
command, I launched thephp bin/magento queue:consumers:start product_action_attribute.update --max-messages=20
command by setting a cron every hour, so it works.Please check with your memory limit setting on phpifno()
for the time being there is workaround to memory limit using the following command:
This is caused 1 of 2 possible issues, and should be checked in this order:
(1) You absolutely do not have even memory assigned to Magento. It doesn’t really matter if you -1 at the PHP level, if the OS level isn’t assigning enough Memory, you’re stuck. Check with your host.
(2) you have an error within your bulk update script, or some code elsewhere that is exhausting the memory allocation.
BUT as memory is exhausted at what is effectively 0.13Gb and, as
archvayu
mentioned above, you need at least 2Gb, I’d look straight into (1) before doing anything else.