Skip to content

Migration error when attempting to upgrate a site that uses async-queue from Craft 3.3.20.1 => 3.4.11. #30

@tomdavies

Description

@tomdavies

Hey @ostark 👋,

Plugin version: 2.1.0

Not sure if this a bug, but thought I'd report it just in case. I hit an error when attempting to upgrate a site that uses async-queue from Craft 3.3.20.1 => 3.4.11.

When running ./craft migrate/all I got this error (full stack trace after):

Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'channel' in 'where clause'
The SQL being executed was: UPDATE `queue` SET `dateReserved`=NULL, `timeUpdated`=NULL, `progress`=0, `progressLabel`=NULL WHERE ((`channel`='queue') AND (`fail`=FALSE)) AND (`timeUpdated` < 1585647734 - `ttr`) (/app/vendor/yiisoft/yii2/db/Schema.php:674)

Disabling async-queue and running again (albeit with a fresh database dump) worked, so it's not blocking me any more, just thought you should know about it.

Happy to try and make a reduced test case if that's helpful....

Stack trace:

The SQL being executed was: UPDATE `queue` SET `dateReserved`=NULL, `timeUpdated`=NULL, `progress`=0, `progressLabel`=NULL WHERE ((`channel`='queue') AND (`fail`=FALSE)) AND (`timeUpdated` < 1585647734 - `ttr`) (/app/vendor/yiisoft/yii2/db/Schema.php:674)
#0 /app/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'UPDATE `queue` ...')
#1 /app/vendor/yiisoft/yii2/db/Command.php(1093): yii\db\Command->internalExecute('UPDATE `queue` ...')
#2 /app/vendor/craftcms/cms/src/queue/Queue.php(653): yii\db\Command->execute()
#3 /app/vendor/craftcms/cms/src/queue/Queue.php(341): craft\queue\Queue->_moveExpired()
#4 /app/vendor/ostark/craft-async-queue/src/RateLimiter.php(39): craft\queue\Queue->getTotalReserved()
#5 /app/vendor/ostark/craft-async-queue/src/Handlers/BackgroundQueueHandler.php(36): ostark\AsyncQueue\RateLimiter->canIUse('Resaving elemen...')
#6 [internal function]: ostark\AsyncQueue\Handlers\BackgroundQueueHandler->__invoke(Object(yii\queue\PushEvent))
#7 /app/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(ostark\AsyncQueue\Handlers\BackgroundQueueHandler), Object(yii\queue\PushEvent))
#8 /app/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\\queue\\Que...', 'afterPush', Object(yii\queue\PushEvent))
#9 /app/vendor/yiisoft/yii2-queue/src/Queue.php(197): yii\base\Component->trigger('afterPush', Object(yii\queue\PushEvent))
#10 /app/vendor/craftcms/cms/src/queue/Queue.php(174): yii\queue\Queue->push(Object(craft\queue\jobs\ResaveElements))
#11 /app/vendor/verbb/navigation/src/services/Nodes.php(150): craft\queue\Queue->push(Object(craft\queue\jobs\ResaveElements))
#12 [internal function]: verbb\navigation\services\Nodes->afterSaveSiteHandler(Object(craft\events\SiteEvent))
#13 /app/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Array, Object(craft\events\SiteEvent))
#14 /app/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\\services\\...', 'afterSaveSite', Object(craft\events\SiteEvent))
#15 /app/vendor/craftcms/cms/src/services/Sites.php(795): yii\base\Component->trigger('afterSaveSite', Object(craft\events\SiteEvent))
#16 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(1099): craft\services\Sites->handleChangedSite(Object(craft\events\ConfigEvent))
#17 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#18 /app/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#19 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(675): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#20 /app/vendor/craftcms/cms/src/helpers/ProjectConfig.php(89): craft\services\ProjectConfig->processConfigChanges('sites.1fae7cf9-...')
#21 /app/vendor/craftcms/cms/src/services/Sections.php(595): craft\helpers\ProjectConfig::ensureAllSitesProcessed()
#22 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(1099): craft\services\Sections->handleChangedSection(Object(craft\events\ConfigEvent))
#23 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#24 /app/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#25 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(675): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#26 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(1089): craft\services\ProjectConfig->processConfigChanges('sections.0b8ab5...')
#27 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#28 /app/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#29 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(672): yii\base\Component->trigger('addItem', Object(craft\events\ConfigEvent))
#30 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(489): craft\services\ProjectConfig->processConfigChanges('sections.0b8ab5...', true, '')
#31 /app/vendor/craftcms/cms/src/migrations/m190913_152146_update_preview_targets.php(54): craft\services\ProjectConfig->set('sections.0b8ab5...', Array)
#32 /app/vendor/craftcms/cms/src/db/Migration.php(52): craft\migrations\m190913_152146_update_preview_targets->safeUp()
#33 /app/vendor/craftcms/cms/src/db/MigrationManager.php(233): craft\db\Migration->up(true)
#34 /app/vendor/craftcms/cms/src/db/MigrationManager.php(153): craft\db\MigrationManager->migrateUp(Object(craft\migrations\m190913_152146_update_preview_targets))
#35 /app/vendor/craftcms/cms/src/services/Updates.php(225): craft\db\MigrationManager->up()
#36 /app/vendor/craftcms/cms/src/console/controllers/MigrateController.php(259): craft\services\Updates->runMigrations(Array)
#37 [internal function]: craft\console\controllers\MigrateController->actionAll()
#38 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#39 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#40 /app/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('all', Array)
#41 /app/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('all', Array)
#42 /app/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#43 /app/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('migrate/all', Array)
#44 /app/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#45 /app/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#46 /app/craft(22): yii\base\Application->run()
#47 {main}
Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Craft CMS.'

in /app/vendor/craftcms/cms/src/services/Updates.php:241

Stack trace:
#0 /app/vendor/craftcms/cms/src/console/controllers/MigrateController.php(259): craft\services\Updates->runMigrations(Array)
#1 [internal function]: craft\console\controllers\MigrateController->actionAll()
#2 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 /app/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('all', Array)
#5 /app/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('all', Array)
#6 /app/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#7 /app/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('migrate/all', Array)
#8 /app/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#9 /app/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#10 /app/craft(22): yii\base\Application->run()
#11 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions