Magento 2 – Fixing Bulk Actions Not Starting

bulk-products-updatecronmagento2.3.2

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

Best Answer

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);
        }
 }
Related Topic