craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

"Resaving products" job fails when using queue/listen #5568

Closed luizhv closed 4 years ago

luizhv commented 4 years ago

Description

We've got a multi-site Craft install with a Deamon set up to run queue/listen (runQueueAutomatically is set to false).

Since updating to Craft 3.4.2, we're seeing the "Resaving products" job consistently failing, when runQueueAutomatically is set to true or if I re-run the job via admin panel it works.

Screen Shot 2020-02-03 at 11 09 37 AM

Steps to reproduce

1. 2.

Additional info

brandonkelly commented 4 years ago

Please update Craft to 3.4.3, and then try to reproduce this error. If it happens again, search for that error in storage/logs/queue.log(.x) and post the stack trace that follows it.

(It’s important that you update Craft first, because we just started outputting full error reports in the logs for queue jobs in 3.4.3.)

luizhv commented 4 years ago

Thanks for you reply @brandonkelly, I updated to Craft 3.4.3 and now I can see the stack trace, apparently, it is a plugin (Currency Prices) that is causing the error, I'll contact them.

2020-02-05 11:24:40 [-][-][-][error][craft\queue\QueueLogBehavior::afterError]  [1] Resaving products (attempt: 1) - Error (time: 0.090s): Calling unknown method: craft\console\Request::getBodyParam()
2020-02-05 11:24:40 [-][-][-][error][yii\base\UnknownMethodException] yii\base\UnknownMethodException: Calling unknown method: craft\console\Request::getBodyParam() in /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /Users/luiz/Projects/trubridge/vendor/kuriousagency/commerce-currency-prices/src/CurrencyPrices.php(154): yii\base\Component->__call('getBodyParam', Array)
#1 [internal function]: kuriousagency\commerce\currencyprices\CurrencyPrices->kuriousagency\commerce\currencyprices\{closure}(Object(craft\events\ModelEvent))
#2 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\ModelEvent))
#3 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\\base\\Elem...', 'beforeSave', Object(craft\events\ModelEvent))
#4 /Users/luiz/Projects/trubridge/vendor/craftcms/cms/src/base/Element.php(2517): yii\base\Component->trigger('beforeSave', Object(craft\events\ModelEvent))
#5 /Users/luiz/Projects/trubridge/vendor/craftcms/commerce/src/elements/Product.php(911): craft\base\Element->beforeSave(false)
#6 /Users/luiz/Projects/trubridge/vendor/craftcms/cms/src/services/Elements.php(1951): craft\commerce\elements\Product->beforeSave(false)
#7 /Users/luiz/Projects/trubridge/vendor/craftcms/cms/src/services/Elements.php(596): craft\services\Elements->_saveElementInternal(Object(craft\commerce\elements\Product), true, true, false)
#8 /Users/luiz/Projects/trubridge/vendor/craftcms/cms/src/queue/jobs/ResaveElements.php(66): craft\services\Elements->resaveElements(Object(craft\commerce\elements\db\ProductQuery), false, true, false)
#9 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2-queue/src/Queue.php(246): craft\queue\jobs\ResaveElements->execute(Object(craft\queue\Queue))
#10 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2-queue/src/cli/Queue.php(162): yii\queue\Queue->handleMessage('1', 'O:31:"craft\\que...', '300', '1')
#11 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2-queue/src/cli/Command.php(146): yii\queue\cli\Queue->execute('1', 'O:31:"craft\\que...', '300', '1', NULL)
#12 [internal function]: yii\queue\cli\Command->actionExec('1', '300', '1', '0')
#13 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#14 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#15 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('exec', Array)
#16 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('exec', Array)
#17 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('queue/exec', Array)
#18 /Users/luiz/Projects/trubridge/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('queue/exec', Array)
#19 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('queue/exec', Array)
#20 /Users/luiz/Projects/trubridge/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#21 /Users/luiz/Projects/trubridge/craft(22): yii\base\Application->run()
#22 {main}
brandonkelly commented 4 years ago

Sounds good, thanks!