Search code examples
phpmagentocronmagento2

Bulk update with cron doesn't work - Magento 2


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"

if i see the details: enter image description here

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?


Solution

  • 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 the php bin/magento queue:consumers:start product_action_attribute.update --max-messages=20 command by setting a cron every hour, so it works.