craftcms / cms

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

Job priority is not supported in the driver (Redis queue) #7719

Closed davist11 closed 3 years ago

davist11 commented 3 years ago

Description

We are using the yii redis queue:

'queue' => [
    'class'   => yii\queue\redis\Queue::class,
    'redis'   => 'redis',
    'channel' => 'queue',
    'ttr'     => 60 * 60 * 6 // 6 hours
],

We all of a sudden started getting the following error when applying project config changes via CLI:

  - updating entryTypes.f40d7e94-fa6d-4001-92e2-a177aa1a3a00 ... 
error: Job priority is not supported in the driver.

We also noticed this happens when we removed an entry from an entries field and then saved the entry:

yii\base\NotSupportedException: Job priority is not supported in the driver. in /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2-queue/src/drivers/redis/Queue.php:191
Stack trace:
#0 /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2-queue/src/Queue.php(196): yii\queue\redis\Queue->pushMessage()
#1 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/helpers/Queue.php(56): yii\queue\Queue->push()
#2 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/services/Elements.php(2575): craft\helpers\Queue::push()
#3 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/services/Elements.php(755): craft\services\Elements->_saveElementInternal()
#4 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/services/Matrix.php(729): craft\services\Elements->saveElement()
#5 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/fields/Matrix.php(997): craft\services\Matrix->saveField()
#6 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/base/Element.php(3359): craft\fields\Matrix->afterElementPropagate()
#7 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/elements/Entry.php(1580): craft\base\Element->afterPropagate()
#8 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/services/Elements.php(2520): craft\elements\Entry->afterPropagate()
#9 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/services/Elements.php(755): craft\services\Elements->_saveElementInternal()
#10 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/controllers/EntriesController.php(382): craft\services\Elements->saveElement()
#11 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#12 /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#13 /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams()
#14 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction()
#15 /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction()
#16 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction()
#17 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction()
#18 /var/www/mwi/production/releases/20210323165926/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest()
#19 /var/www/mwi/production/releases/20210323165926/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest()
#20 /var/www/mwi/production/releases/20210323165926/web/index.php(22): yii\base\Application->run()
#21 {main}

And when saving an entry type:

yii\base\NotSupportedException: Job priority is not supported in the driver. in /var/www/html/vendor/yiisoft/yii2-queue/src/drivers/redis/Queue.php:191
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2-queue/src/Queue.php(196): yii\queue\redis\Queue->pushMessage('O:31:"craft\\que...', 21600, 0, 2049)
#1 /var/www/html/vendor/craftcms/cms/src/helpers/Queue.php(56): yii\queue\Queue->push(Object(craft\queue\jobs\PruneRevisions))
#2 /var/www/html/vendor/craftcms/cms/src/services/Revisions.php(196): craft\helpers\Queue::push(Object(craft\queue\jobs\PruneRevisions), 2049)
#3 /var/www/html/vendor/craftcms/cms/src/elements/Entry.php(1584): craft\services\Revisions->createRevision(Object(craft\elements\Entry), 2, NULL)
#4 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(2520): craft\elements\Entry->afterPropagate(false)
#5 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(755): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), false, false, true)
#6 /var/www/html/vendor/craftcms/cms/src/services/Sections.php(1525): craft\services\Elements->saveElement(Object(craft\elements\Entry), false)
#7 /var/www/html/vendor/craftcms/cms/src/services/Sections.php(1221): craft\services\Sections->_ensureSingleEntry(Object(craft\models\Section))
#8 /var/www/html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1664): craft\services\Sections->handleChangedEntryType(Object(craft\events\ConfigEvent))
#9 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(1181): craft\web\Application->craft\base\{closure}(Object(craft\events\ConfigEvent))
#10 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#11 /var/www/html/vendor/yiisoft/yii2/base/Component.php(628): call_user_func(Array, Object(craft\events\ConfigEvent))
#12 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(744): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#13 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(517): craft\services\ProjectConfig->_processConfigChangesInternal('entryTypes.0944...', true, 'Save entry type...')
#14 /var/www/html/vendor/craftcms/cms/src/services/Sections.php(1117): craft\services\ProjectConfig->set('entryTypes.0944...', Array, 'Save entry type...')
#15 /var/www/html/vendor/craftcms/cms/src/controllers/SectionsController.php(344): craft\services\Sections->saveEntryType(Object(craft\models\EntryType))
#16 [internal function]: craft\controllers\SectionsController->actionSaveEntryType()
#17 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#18 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#19 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('save-entry-type', Array)
#20 /var/www/html/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('save-entry-type', Array)
#21 /var/www/html/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('sections/save-e...', Array)
#22 /var/www/html/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction('sections/save-e...', Array)
#23 /var/www/html/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#24 /var/www/html/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#25 /var/www/html/web/index.php(22): yii\base\Application->run()
#26 {main}

Steps to reproduce

  1. Use the yiisoft/yii2-redis queue component
  2. Try to do any of the 3 actions above

Additional info

Amazon S3 1.2.11
Asset Rev 6.0.2
Classnames 1.0.3
Command Palette 3.1.4
Craft Commerce 3.2.15.2
Feed Me 4.3.5.1
Imgix 2.1.0
Linkit 1.1.12.1
Navigation 1.4.14
Ray 1.1.4
Redactor 2.8.5
Scout 2.3.1
SEOmatic 3.3.35
Super Table 2.6.7
Table Maker 2.0.1
brandonkelly commented 3 years ago

Thanks for reporting that! Just released 3.6.11.1 with a fix.