-
Notifications
You must be signed in to change notification settings - Fork 679
Open
Labels
Description
What happened?
Description
When running the migration from craft 4.15 to 5.7, I am seeing this error:
> [18029/18032] Updating element 125620 ... done
> [18030/18032] Updating element 125620 ... done
> [18031/18032] Updating element 125620 ... done
> [18032/18032] Updating element 125620 ... done
> update in {{%elements}} ... done (time: 0.161s)
> update in {{%changedfields}} ... done (time: 0.076s)
> delete from {{%matrixcontent_awards}} ... done (time: 0.056s)
> drop table {{%matrixcontent_awards}} ...Exception: SQLSTATE[40P01]: Deadlock detected: 7 ERROR: deadlock detected
DETAIL: Process 2654 waits for AccessExclusiveLock on relation 34280 of database 16404; blocked by process 2702.
Process 2702 waits for AccessShareLock on relation 34292 of database 16404; blocked by process 2654.
HINT: See server log for query details.
The SQL being executed was: DROP TABLE "craft_matrixcontent_awards" (/var/www/html/vendor/yiisoft/yii2/db/Schema.php:676)
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1325): yii\db\Schema->convertException(Object(PDOException), 'DROP TABLE "cra...')
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1120): yii\db\Command->internalExecute('DROP TABLE "cra...')
#2 /var/www/html/vendor/yiisoft/yii2/db/Migration.php(362): yii\db\Command->execute()
#3 /var/www/html/vendor/craftcms/cms/src/migrations/BaseContentRefactorMigration.php(203): yii\db\Migration->dropTable('{{%matrixconten...')
#4 /var/www/html/vendor/craftcms/cms/src/migrations/m230511_215903_content_refactor.php(122): craft\migrations\BaseContentRefactorMigration->updateElements(Object(craft\db\Query), Object(craft\models\FieldLayout), '{{%matrixconten...', 'field_award_')
#5 /var/www/html/vendor/craftcms/cms/src/db/Migration.php(50): craft\migrations\m230511_215903_content_refactor->safeUp()
#6 /var/www/html/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
#7 /var/www/html/vendor/craftcms/cms/src/console/controllers/MigrateController.php(373): yii\console\controllers\BaseMigrateController->migrateUp('m230511_215903_...')
#8 [internal function]: craft\console\controllers\MigrateController->actionAll()
#9 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#11 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
#12 /var/www/html/vendor/craftcms/cms/src/console/controllers/MigrateController.php(192): yii\console\Controller->runAction('all', Array)
#13 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
#14 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#15 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
#16 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(212): craft\console\Application->runAction('migrate/all', Array)
#17 /var/www/html/vendor/craftcms/cms/src/console/Controller.php(207): yii\base\Controller->run('migrate/all', Array)
#18 /var/www/html/vendor/craftcms/cms/src/console/controllers/UpController.php(60): craft\console\Controller->run('migrate/all', Array)
#19 [internal function]: craft\console\controllers\UpController->actionIndex()
#20 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#21 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#22 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
#23 /var/www/html/vendor/craftcms/cms/src/console/ControllerTrait.php(88): yii\console\Controller->runAction('', Array)
#24 /var/www/html/vendor/craftcms/cms/src/console/Controller.php(216): craft\console\Controller->traitRunAction('', Array)
#25 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
#26 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('up', Array)
#27 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('up', Array)
#28 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('up', Array)
#29 /var/www/html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
#30 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
#31 /var/www/html/craft(22): yii\base\Application->run()
#32 {main}
*** failed to apply m230511_215903_content_refactor (time: 310.881s)
7 from 41 migrations were applied.
Migration failed. The rest of the migrations are canceled.
Restore a database backup before trying again.
Not sure why, I was successful running this with a different data set (this is happening in in stage, locally everything is running fine - stage data is a bit stale). I was doing this as a final sanity check before I go to prod with this.
I made sure no jobs were running, or were scheduled:
Jobs
- waiting: 0
- delayed: 0
- reserved: 0
- failed: 0
There are no locks on the db, so not sure what is going on. Any help would be much appreciated.
4.15 composer:
"cloudinary/cloudinary_php": "^1.13",
"clubstudioltd/craft-asset-rev": "^7.0.0",
"craftcms/aws-s3": "2.2.2",
"craftcms/ckeditor": "^3.13.0",
"craftcms/cms": "4.15.6.1",
"firebase/php-jwt": "^5.2",
"google/analytics-data": "^0.9.4",
"google/apiclient": "^2.0.0",
"ip2location/ip2location-php": "^8.0",
"spicyweb/craft-neo": "4.4.2",
The 5:
"cloudinary/cloudinary_php": "^1.13",
"clubstudioltd/craft-asset-rev": "^8.0.0",
"craftcms/aws-s3": "2.2.2",
"craftcms/ckeditor": "^4.9.0",
"craftcms/cms": "5.7.10",
"firebase/php-jwt": "^5.2",
"google/analytics-data": "^0.9.4",
"google/apiclient": "^2.0.0",
"ip2location/ip2location-php": "^8.0",
"spicyweb/craft-neo": "5.4.4",
Craft CMS version
5.7.10
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response