Question

After trying to update attributes for 4 products in Magento 2.3.2 the Bulk Actions log shows that the update tasks have not started.

My Magento cron jobs appear to be running ok, why are bulk action tasks not starting?

enter image description here

UPDATE

After upgrading to Magento 2.3.3 I still had this problem. I had been using www-data as the file owner for my development system which I know is a bad practice. After resetting permissions as per Magento documentation and ensuring cron job was running as correct file owner the bulk actions run correctly.

UPDATE Magento 2.4.x

This problem has appeared again in Magento 2.4

See the following issue https://github.com/magento/magento2/issues/29797

Was it helpful?

Solution

Seems like a bug to me.

I fixed it by modifying this function in vendor/magento/module-asynchronous-operations/Model/BulkManagement.php

Bad of me but hey, maybe it's a PR :)

private function publishOperations(array $operations)
 {
        $operationsByTopics = [];
        foreach ($operations as $operation) {
+            $this->entityManager->save($operation);
            $operationsByTopics[$operation->getTopicName()][] = $operation;
        }
        foreach ($operationsByTopics as $topicName => $operations) {
            $this->publisher->publish($topicName, $operations);
        }
 }

OTHER TIPS

Magento 2.4

This issue is solved here: https://github.com/magento/magento2/pull/29814/files

https://github.com/magento/magento2/issues/29797#issuecomment-698561956

If the old message is still shown then you can delete it from the magento_bulk and magento_bulk_acknowledged tables.

https://github.com/magento/magento2/issues/29797#issuecomment-700537460

Thank you.

The magento cron in your web server is disabled. Set Magento cron by command line

crontab -e 

*/1 * * * * php -c {php.ini_path} {magento_path}/bin/magento cron:run
*/1 * * * * php -c {php.ini_path} {magento_path}/update/cron.php
*/1 * * * * php -c {php.ini_path} {magento_path}/bin/magento setup:cron:run

Or simply way is

php bin/magento cron:install [--force]

Maybe this is your idea, You can check again:

  1. Check again connect magento 2 to rabiitmq(php bin/magento queue:consumer:start)
  2. Check again process queue:consumer:start is starting(ps aux | grep "queue:consumer:start")
  3. Test Rest API with specifying API
  4. Copy data to test bulk API with same data, same routers

I manually started the queue with php bin/magento queue:consumer:start product_action_attribute.update, now all the tasks in the queue where running successfully.

But it looks like this is a bug and you shouldnt have to run this manually.

I had the same issue in Magento 2.4.2. But was fixed after changed the db-schema.xml as describes in this post How to Fix Magneto 2 Bulk Actions Not Starting

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top