14

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

13
  • 3
    Have you find the solution for this? I am also facing this Jul 19 '19 at 6:20
  • After a few days I noticed the bulk action tasks had ran. I need to test this some more as I do not know why the bulk actions failed to start, but then were executed some days later.
    – paj
    Jul 19 '19 at 8:38
  • No, obviously there is a problem and we need to find out how to troubleshoot bulk action tasks.
    – paj
    Jul 19 '19 at 10:54
  • what is the solution? Jan 14 '20 at 18:20
  • upgrade to 2.3.3 ensure cron jobs are configured as per Magento docs.
    – paj
    Jan 14 '20 at 18:42
4

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);
        }
 }
7
  • Well spotted! I expect it will be fixed in the next release.
    – paj
    Jul 31 '19 at 15:58
  • 2
    Created a ticket github.com/magento/magento2/issues/23958
    – Tristan H
    Aug 5 '19 at 12:28
  • I have updated above code but not working. Oct 15 '19 at 10:47
  • I have updated my question I think file owner permissions / cron owner could be contributing to this issue.
    – paj
    Oct 27 '19 at 10:33
  • I applied those code but it is not working. Any other solution for 2.3.2 Jan 14 '20 at 19:32
3

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.

1

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]
5
  • My cron jobs are running fine - just the bulk action tasks are not executing in a timely manner.
    – paj
    Jul 30 '19 at 12:49
  • launch this command 'bin/magento cron:run'
    – yavonz15
    Jul 30 '19 at 13:35
  • after running bin/magento cron:run the bulk action task still has not ran - detail log shows it is pending in queue.
    – paj
    Jul 30 '19 at 14:11
  • php version server??
    – yavonz15
    Jul 30 '19 at 14:41
  • should the cron jobs be ran as the file system owner?
    – paj
    Oct 26 '19 at 12:05
1

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
2
1

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.

0

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

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