Magento 2 Bulk Actions not Starting
-
07-03-2021 - |
質問
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?
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
解決
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);
}
}
他のヒント
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:
- Check again connect magento 2 to rabiitmq(
php bin/magento queue:consumer:start
) - Check again process queue:consumer:start is starting(
ps aux | grep "queue:consumer:start"
) - Test Rest API with specifying API
- Copy data to test bulk API with same data, same routers