Closed khalwat closed 11 months ago
The elements_sites
table doesn’t have a title
column in Craft 4.
Did you attempt to update this database multiple times, without restoring a DB backup in between?
@brandonkelly nope, I did a fresh db dump from Craft 4 and then used that db as the starter db for Craft 5
In between attempts, I nuked the db volumes entirely, so the db seed would be fresh
Also FWIW I've heard from others they have had issues updating from Craft 4 to Craft 5 since sometime a bit after the initial "release" at DotAll. Installing fresh apparently works ok though (I haven't tried)
Liar! Just tried with your DB dump and got this the first time:
Exception: Invalid field layout ID: 8 (/var/www/html/repos/cms/src/behaviors/FieldLayoutBehavior.php:125)
(If I re-attempted without re-importing the DB backup, I could reproduce your reported error.)
Fixed now for the next release.
hmmmmm. I did try it a half dozen or so times, I guess I copied the wrong portion of the error log. Sorry!
Okay so actually, I didn't lie... it was done from a clean db each time, but I was looking at the wrong container's output.
The PHP container (plugindev-php_v5-1)
actually ran the migrations that failed.
The error output that I erroneously put here was the output from the queue container (plugindev-queue_v5-1
) which then tried to re-run the migrations that had already failed (and thus failed for different reasons).
Here's the actual error output I should have put here, for completeness:
plugindev-php_v5-1 | Checking for pending Craft and plugin migrations ...
plugindev-php_v5-1 | Total 14 new Craft migrations to be applied:
plugindev-php_v5-1 | - m221205_082005_translatable_asset_alt_text
plugindev-php_v5-1 | - m230314_110309_add_authenticator_table
plugindev-php_v5-1 | - m230314_111234_add_webauthn_table
plugindev-php_v5-1 | - m230503_120303_add_recoverycodes_table
plugindev-php_v5-1 | - m230511_215903_content_refactor
plugindev-php_v5-1 | - m230524_220029_global_entry_types
plugindev-php_v5-1 | - m230606_184054_field_layout_configs
plugindev-php_v5-1 | - m230616_173810_kill_field_groups
plugindev-php_v5-1 | - m230616_183820_remove_field_name_limit
plugindev-php_v5-1 | - m230617_070415_entrify_matrix_blocks
plugindev-php_v5-1 | - m230904_190356_address_fields
plugindev-php_v5-1 | - m230928_144045_add_subpath_to_volumes
plugindev-php_v5-1 | - m231013_185640_changedfields_amend_primary_key
plugindev-php_v5-1 | - m231213_030600_element_bulk_ops
plugindev-php_v5-1 |
plugindev-php_v5-1 | Skipping database backup.
plugindev-php_v5-1 | *** applying m221205_082005_translatable_asset_alt_text
plugindev-php_v5-1 | > add column altTranslationMethod string NOT NULL DEFAULT 'site' AFTER `titleTranslationKeyFormat` to table {{%volumes}} ... done (time: 0.036s)
plugindev-php_v5-1 | > add column altTranslationKeyFormat text AFTER `altTranslationMethod` to table {{%volumes}} ... done (time: 0.012s)
plugindev-php_v5-1 | > dropping {{%assets_sites}} if it exists ... done (time: 0.001s)
plugindev-php_v5-1 | > create table {{%assets_sites}} ... done (time: 0.008s)
plugindev-php_v5-1 | > add foreign key fk_pnocmpzprkltmjsazdpssaiqukwxiogdtkrn: {{%assets_sites}} (assetId) references {{%assets}} (id) ... done (time: 0.019s)
plugindev-php_v5-1 | > add foreign key fk_ghdzszotzhbgacbnibmbbadxkpgzijjhzhrg: {{%assets_sites}} (siteId) references {{%sites}} (id) ... done (time: 0.020s)
plugindev-php_v5-1 | *** applied m221205_082005_translatable_asset_alt_text (time: 0.106s)
plugindev-php_v5-1 |
plugindev-php_v5-1 | *** applying m230314_110309_add_authenticator_table
plugindev-php_v5-1 | > dropping {{%authenticator}} if it exists ... done (time: 0.002s)
plugindev-php_v5-1 | > create table {{%authenticator}} ... done (time: 0.007s)
plugindev-php_v5-1 | *** applied m230314_110309_add_authenticator_table (time: 0.032s)
plugindev-php_v5-1 |
plugindev-php_v5-1 | *** applying m230314_111234_add_webauthn_table
plugindev-php_v5-1 | > dropping {{%webauthn}} if it exists ... done (time: 0.001s)
plugindev-php_v5-1 | > create table {{%webauthn}} ... done (time: 0.008s)
plugindev-php_v5-1 | > add foreign key fk_oyobidghvwdnydiavaeevytwizotgqhhabfk: {{%webauthn}} (userId) references {{%users}} (id) ... done (time: 0.034s)
plugindev-php_v5-1 | *** applied m230314_111234_add_webauthn_table (time: 0.047s)
plugindev-php_v5-1 |
plugindev-php_v5-1 | *** applying m230503_120303_add_recoverycodes_table
plugindev-php_v5-1 | > dropping {{%recoverycodes}} if it exists ... done (time: 0.003s)
plugindev-php_v5-1 | > create table {{%recoverycodes}} ... done (time: 0.013s)
plugindev-php_v5-1 | > add foreign key fk_fazzlegpoyelyshkeryymwzrcvysqbiohdvt: {{%recoverycodes}} (userId) references {{%users}} (id) ... done (time: 0.019s)
plugindev-php_v5-1 | *** applied m230503_120303_add_recoverycodes_table (time: 0.038s)
plugindev-php_v5-1 |
plugindev-php_v5-1 | *** applying m230511_215903_content_refactor
plugindev-php_v5-1 | > add column title string AFTER `siteId` to table {{%elements_sites}} ... done (time: 0.008s)
plugindev-php_v5-1 | > add column content json AFTER `uri` to table {{%elements_sites}} ... done (time: 0.006s)
plugindev-php_v5-1 | > create index idx_oojsbshpedzrnqyoxavllihyduwiuvlyhfbk on {{%elements_sites}} (title,siteId) ... done (time: 0.014s)
plugindev-php_v5-1 | > add column layoutElementUid char(36) NOT NULL DEFAULT '0' AFTER `fieldId` to table {{%changedfields}} ... done (time: 0.007s)
plugindev-php_v5-1 | > update in {{%elements}} ... done (time: 0.002s)
plugindev-php_v5-1 | > delete from {{%content}} ... done (time: 0.000s)
plugindev-php_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-php_v5-1 | > delete from {{%content}} ... done (time: 0.000s)
plugindev-php_v5-1 | Exception: Invalid field layout ID: 8 (/var/www/project/cms_v5/vendor/craftcms/cms/src/behaviors/FieldLayoutBehavior.php:125)
plugindev-php_v5-1 | #0 /var/www/project/cms_v5/vendor/craftcms/cms/src/models/EntryType.php(220): craft\behaviors\FieldLayoutBehavior->getFieldLayout()
plugindev-php_v5-1 | #1 /var/www/project/cms_v5/vendor/craftcms/cms/src/migrations/m230511_215903_content_refactor.php(73): craft\models\EntryType->getFieldLayout()
plugindev-php_v5-1 | #2 /var/www/project/cms_v5/vendor/craftcms/cms/src/db/Migration.php(49): craft\migrations\m230511_215903_content_refactor->safeUp()
plugindev-php_v5-1 | #3 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
plugindev-php_v5-1 | #4 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/MigrateController.php(365): yii\console\controllers\BaseMigrateController->migrateUp('m230511_215903_...')
plugindev-php_v5-1 | #5 [internal function]: craft\console\controllers\MigrateController->actionAll()
plugindev-php_v5-1 | #6 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-php_v5-1 | #7 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-php_v5-1 | #8 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
plugindev-php_v5-1 | #9 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('all', Array)
plugindev-php_v5-1 | #10 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
plugindev-php_v5-1 | #11 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
plugindev-php_v5-1 | #12 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
plugindev-php_v5-1 | #13 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(212): craft\console\Application->runAction('migrate/all', Array)
plugindev-php_v5-1 | #14 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(208): yii\base\Controller->run('migrate/all', Array)
plugindev-php_v5-1 | #15 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/UpController.php(66): craft\console\Controller->run('migrate/all', Array)
plugindev-php_v5-1 | #16 [internal function]: craft\console\controllers\UpController->actionIndex()
plugindev-php_v5-1 | #17 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-php_v5-1 | #18 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-php_v5-1 | #19 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
plugindev-php_v5-1 | #20 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('', Array)
plugindev-php_v5-1 | #21 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(217): craft\console\Controller->traitRunAction('', Array)
plugindev-php_v5-1 | #22 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
plugindev-php_v5-1 | #23 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('up', Array)
plugindev-php_v5-1 | #24 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('up', Array)
plugindev-php_v5-1 | #25 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('up', Array)
plugindev-php_v5-1 | #26 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
plugindev-php_v5-1 | #27 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
plugindev-php_v5-1 | #28 /var/www/project/cms_v5/craft(15): yii\base\Application->run()
plugindev-php_v5-1 | #29 {main}
plugindev-php_v5-1 | *** failed to apply m230511_215903_content_refactor (time: 0.104s)
plugindev-php_v5-1 |
plugindev-php_v5-1 |
plugindev-php_v5-1 | 4 from 14 migrations were applied.
plugindev-php_v5-1 |
plugindev-php_v5-1 | Migration failed. The rest of the migrations are canceled.
plugindev-php_v5-1 |
plugindev-php_v5-1 | Restore a database backup before trying again.
plugindev-php_v5-1 |
plugindev-php_v5-1 | Aborting remaining tasks.
plugindev-php_v5-1 | 2023-12-14 21:13:38 [console.WARNING] [craft\models\FieldLayoutTab::setElements] Invalid field layout element config: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField {"memory":18799720}
plugindev-php_v5-1 | 2023-12-14 21:13:38 [console.ERROR] [yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField in /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php:969
plugindev-php_v5-1 | Stack trace:
plugindev-php_v5-1 | #0 /var/www/project/cms_v5/vendor/craftcms/cms/src/models/FieldLayoutTab.php(254): craft\services\Fields->createLayoutElement(Array)
plugindev-php_v5-1 | #1 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Component.php(180): craft\models\FieldLayoutTab->setElements(Array)
plugindev-php_v5-1 | #2 /var/www/project/cms_v5/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('elements', Array)
plugindev-php_v5-1 | #3 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\models\FieldLayoutTab), Array)
plugindev-php_v5-1 | #4 /var/www/project/cms_v5/vendor/craftcms/cms/src/base/Model.php(78): yii\base\BaseObject->__construct(Array)
plugindev-php_v5-1 | #5 /var/www/project/cms_v5/vendor/craftcms/cms/src/models/FieldLayoutTab.php(122): craft\base\Model->__construct(Array)
plugindev-php_v5-1 | #6 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(864): craft\models\FieldLayoutTab->__construct(Array)
plugindev-php_v5-1 | #7 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(790): craft\services\Fields->_legacyTabsByLayoutId(Object(craft\models\FieldLayout))
plugindev-php_v5-1 | #8 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(878): craft\services\Fields->_layouts()
plugindev-php_v5-1 | #9 /var/www/project/cms_v5/vendor/craftcms/cms/src/migrations/m230511_215903_content_refactor.php(26): craft\services\Fields->getAllLayouts()
plugindev-php_v5-1 | #10 /var/www/project/cms_v5/vendor/craftcms/cms/src/db/Migration.php(49): craft\migrations\m230511_215903_content_refactor->safeUp()
plugindev-php_v5-1 | #11 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
plugindev-php_v5-1 | #12 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/MigrateController.php(365): yii\console\controllers\BaseMigrateController->migrateUp('m230511_215903_...')
plugindev-php_v5-1 | #13 [internal function]: craft\console\controllers\MigrateController->actionAll()
plugindev-php_v5-1 | #14 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-php_v5-1 | #15 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-php_v5-1 | #16 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
plugindev-php_v5-1 | #17 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('all', Array)
plugindev-php_v5-1 | #18 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
plugindev-php_v5-1 | #19 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
plugindev-php_v5-1 | #20 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
plugindev-php_v5-1 | #21 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(212): craft\console\Application->runAction('migrate/all', Array)
plugindev-php_v5-1 | #22 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(208): yii\base\Controller->run('migrate/all', Array)
plugindev-php_v5-1 | #23 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/UpController.php(66): craft\console\Controller->run('migrate/all', Array)
plugindev-php_v5-1 | #24 [internal function]: craft\console\controllers\UpController->actionIndex()
plugindev-php_v5-1 | #25 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-php_v5-1 | #26 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-php_v5-1 | #27 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
plugindev-php_v5-1 | #28 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('', Array)
plugindev-php_v5-1 | #29 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(217): craft\console\Controller->traitRunAction('', Array)
plugindev-php_v5-1 | #30 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
plugindev-php_v5-1 | #31 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('up', Array)
plugindev-php_v5-1 | #32 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('up', Array)
plugindev-php_v5-1 | #33 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('up', Array)
plugindev-php_v5-1 | #34 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
plugindev-php_v5-1 | #35 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
plugindev-php_v5-1 | #36 /var/www/project/cms_v5/craft(15): yii\base\Application->run()
plugindev-php_v5-1 | #37 {main} {"memory":18799936,"exception":"[object] (yii\\base\\InvalidArgumentException(code: 0): Invalid field layout element class: craft\\commerce\\fieldlayoutelements\\ProductTitleField at /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php:969)"}
@brandonkelly I'm still getting an error after updating my composer.json
to:
"craftcms/cms": "5.0.x-dev as 5.0.0-alpha.2",
...and doing a clean composer install
... looks like there might be remnants of Commerce in the db or such?
(yes, this log is from the queue container plugindev-queue_v5-1
-- intentionally this time):
plugindev-queue_v5-1 | *** applying m230511_000000_field_layout_configs
plugindev-queue_v5-1 | > add column config text AFTER `type` to table {{%fieldlayouts}} ... done (time: 0.083s)
plugindev-queue_v5-1 | > dropping all foreign keys to {{%fieldlayoutfields}} ...2023-12-15 18:44:42 [console.WARNING] [craft\models\FieldLayoutTab::setElements] Invalid field layout element config: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField {"memory":18748856}
plugindev-queue_v5-1 | 2023-12-15 18:44:42 [console.ERROR] [yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField in /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php:969
...though the migrations do seem to complete now, and I'm able to log into the CP. 🎉
Here's the complete migration log:
plugindev-queue_v5-1 | Total 14 new Craft migrations to be applied:
plugindev-queue_v5-1 | - m221205_082005_translatable_asset_alt_text
plugindev-queue_v5-1 | - m230314_110309_add_authenticator_table
plugindev-queue_v5-1 | - m230314_111234_add_webauthn_table
plugindev-queue_v5-1 | - m230503_120303_add_recoverycodes_table
plugindev-queue_v5-1 | - m230511_000000_field_layout_configs
plugindev-queue_v5-1 | - m230511_215903_content_refactor
plugindev-queue_v5-1 | - m230524_220029_global_entry_types
plugindev-queue_v5-1 | - m230616_173810_kill_field_groups
plugindev-queue_v5-1 | - m230616_183820_remove_field_name_limit
plugindev-queue_v5-1 | - m230617_070415_entrify_matrix_blocks
plugindev-queue_v5-1 | - m230904_190356_address_fields
plugindev-queue_v5-1 | - m230928_144045_add_subpath_to_volumes
plugindev-queue_v5-1 | - m231013_185640_changedfields_amend_primary_key
plugindev-queue_v5-1 | - m231213_030600_element_bulk_ops
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | Skipping database backup.
plugindev-queue_v5-1 | *** applying m221205_082005_translatable_asset_alt_text
plugindev-queue_v5-1 | > add column altTranslationMethod string NOT NULL DEFAULT 'site' AFTER `titleTranslationKeyFormat` to table {{%volumes}} ... done (time: 0.080s)
plugindev-queue_v5-1 | > add column altTranslationKeyFormat text AFTER `altTranslationMethod` to table {{%volumes}} ... done (time: 0.029s)
plugindev-queue_v5-1 | > dropping {{%assets_sites}} if it exists ... done (time: 0.009s)
plugindev-queue_v5-1 | > create table {{%assets_sites}} ... done (time: 0.027s)
plugindev-queue_v5-1 | > add foreign key fk_lohrehqxdwzlipyhmmslgwucmvcyvqfpqlli: {{%assets_sites}} (assetId) references {{%assets}} (id) ... done (time: 0.094s)
plugindev-queue_v5-1 | > add foreign key fk_ebdnxhazykubfwzipfkekxfbzyeezwisydla: {{%assets_sites}} (siteId) references {{%sites}} (id) ... done (time: 0.096s)
plugindev-queue_v5-1 | *** applied m221205_082005_translatable_asset_alt_text (time: 0.384s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230314_110309_add_authenticator_table
plugindev-queue_v5-1 | > dropping {{%authenticator}} if it exists ... done (time: 0.003s)
plugindev-queue_v5-1 | > create table {{%authenticator}} ... done (time: 0.021s)
plugindev-queue_v5-1 | > add foreign key fk_yaydnkckybkecmjhyyzamaudeqwgytmaovqu: {{%authenticator}} (userId) references {{%users}} (id) ... done (time: 0.029s)
plugindev-queue_v5-1 | *** applied m230314_110309_add_authenticator_table (time: 0.058s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230314_111234_add_webauthn_table
plugindev-queue_v5-1 | > dropping {{%webauthn}} if it exists ... done (time: 0.002s)
plugindev-queue_v5-1 | > create table {{%webauthn}} ... done (time: 0.025s)
plugindev-queue_v5-1 | > add foreign key fk_adxliiyajqzavdemkisbdsrmrovdriwlfqcy: {{%webauthn}} (userId) references {{%users}} (id) ... done (time: 0.086s)
plugindev-queue_v5-1 | *** applied m230314_111234_add_webauthn_table (time: 0.124s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230503_120303_add_recoverycodes_table
plugindev-queue_v5-1 | > dropping {{%recoverycodes}} if it exists ... done (time: 0.005s)
plugindev-queue_v5-1 | > create table {{%recoverycodes}} ... done (time: 0.024s)
plugindev-queue_v5-1 | > add foreign key fk_rojcymeyodhciaoykcqgkxacjkilkcclegtd: {{%recoverycodes}} (userId) references {{%users}} (id) ... done (time: 0.056s)
plugindev-queue_v5-1 | *** applied m230503_120303_add_recoverycodes_table (time: 0.090s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230511_000000_field_layout_configs
plugindev-queue_v5-1 | > add column config text AFTER `type` to table {{%fieldlayouts}} ... done (time: 0.083s)
plugindev-queue_v5-1 | > dropping all foreign keys to {{%fieldlayoutfields}} ...2023-12-15 18:44:42 [console.WARNING] [craft\models\FieldLayoutTab::setElements] Invalid field layout element config: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField {"memory":18748856}
plugindev-queue_v5-1 | 2023-12-15 18:44:42 [console.ERROR] [yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: Invalid field layout element class: craft\commerce\fieldlayoutelements\ProductTitleField in /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php:969
plugindev-queue_v5-1 | Stack trace:
plugindev-queue_v5-1 | #0 /var/www/project/cms_v5/vendor/craftcms/cms/src/models/FieldLayoutTab.php(254): craft\services\Fields->createLayoutElement(Array)
plugindev-queue_v5-1 | #1 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Component.php(180): craft\models\FieldLayoutTab->setElements(Array)
plugindev-queue_v5-1 | #2 /var/www/project/cms_v5/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('elements', Array)
plugindev-queue_v5-1 | #3 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\models\FieldLayoutTab), Array)
plugindev-queue_v5-1 | #4 /var/www/project/cms_v5/vendor/craftcms/cms/src/base/Model.php(78): yii\base\BaseObject->__construct(Array)
plugindev-queue_v5-1 | #5 /var/www/project/cms_v5/vendor/craftcms/cms/src/models/FieldLayoutTab.php(122): craft\base\Model->__construct(Array)
plugindev-queue_v5-1 | #6 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(864): craft\models\FieldLayoutTab->__construct(Array)
plugindev-queue_v5-1 | #7 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(790): craft\services\Fields->_legacyTabsByLayoutId(Object(craft\models\FieldLayout))
plugindev-queue_v5-1 | #8 /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php(878): craft\services\Fields->_layouts()
plugindev-queue_v5-1 | #9 /var/www/project/cms_v5/vendor/craftcms/cms/src/migrations/m230511_000000_field_layout_configs.php(25): craft\services\Fields->getAllLayouts()
plugindev-queue_v5-1 | #10 /var/www/project/cms_v5/vendor/craftcms/cms/src/db/Migration.php(49): craft\migrations\m230511_000000_field_layout_configs->safeUp()
plugindev-queue_v5-1 | #11 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
plugindev-queue_v5-1 | #12 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/MigrateController.php(365): yii\console\controllers\BaseMigrateController->migrateUp('m230511_000000_...')
plugindev-queue_v5-1 | #13 [internal function]: craft\console\controllers\MigrateController->actionAll()
plugindev-queue_v5-1 | #14 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-queue_v5-1 | #15 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-queue_v5-1 | #16 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
plugindev-queue_v5-1 | #17 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('all', Array)
plugindev-queue_v5-1 | #18 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
plugindev-queue_v5-1 | #19 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
plugindev-queue_v5-1 | #20 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
plugindev-queue_v5-1 | #21 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(212): craft\console\Application->runAction('migrate/all', Array)
plugindev-queue_v5-1 | #22 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(208): yii\base\Controller->run('migrate/all', Array)
plugindev-queue_v5-1 | #23 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/controllers/UpController.php(66): craft\console\Controller->run('migrate/all', Array)
plugindev-queue_v5-1 | #24 [internal function]: craft\console\controllers\UpController->actionIndex()
plugindev-queue_v5-1 | #25 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
plugindev-queue_v5-1 | #26 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
plugindev-queue_v5-1 | #27 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
plugindev-queue_v5-1 | #28 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('', Array)
plugindev-queue_v5-1 | #29 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Controller.php(217): craft\console\Controller->traitRunAction('', Array)
plugindev-queue_v5-1 | #30 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
plugindev-queue_v5-1 | #31 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('up', Array)
plugindev-queue_v5-1 | #32 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('up', Array)
plugindev-queue_v5-1 | #33 /var/www/project/cms_v5/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('up', Array)
plugindev-queue_v5-1 | #34 /var/www/project/cms_v5/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
plugindev-queue_v5-1 | #35 /var/www/project/cms_v5/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
plugindev-queue_v5-1 | #36 /var/www/project/cms_v5/craft(15): yii\base\Application->run()
plugindev-queue_v5-1 | #37 {main} {"memory":18749072,"exception":"[object] (yii\\base\\InvalidArgumentException(code: 0): Invalid field layout element class: craft\\commerce\\fieldlayoutelements\\ProductTitleField at /var/www/project/cms_v5/vendor/craftcms/cms/src/services/Fields.php:969)"}
plugindev-queue_v5-1 | done (time: 0.222s)
plugindev-queue_v5-1 | > dropping all foreign keys to {{%fieldlayouttabs}} ... done (time: 0.011s)
plugindev-queue_v5-1 | > dropping {{%fieldlayoutfields}} if it exists ... done (time: 0.020s)
plugindev-queue_v5-1 | > dropping {{%fieldlayouttabs}} if it exists ... done (time: 0.029s)
plugindev-queue_v5-1 | *** applied m230511_000000_field_layout_configs (time: 0.572s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230511_215903_content_refactor
plugindev-queue_v5-1 | > add column title string AFTER `siteId` to table {{%elements_sites}} ... done (time: 0.039s)
plugindev-queue_v5-1 | > add column content json AFTER `uri` to table {{%elements_sites}} ... done (time: 0.029s)
plugindev-queue_v5-1 | > create index idx_fdewpqmwpdhixdajlwzwrfeiqvhgvkfikiap on {{%elements_sites}} (title,siteId) ... done (time: 0.044s)
plugindev-queue_v5-1 | > add column layoutElementUid char(36) NOT NULL DEFAULT '0' AFTER `fieldId` to table {{%changedfields}} ... done (time: 0.024s)
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.005s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > [1/6] Updating entry 17 "My first blog" ... done
plugindev-queue_v5-1 | > [2/6] Updating entry 17 "My first blog" ... done
plugindev-queue_v5-1 | > [3/6] Updating entry revision 18 "My first blog" ... done
plugindev-queue_v5-1 | > [4/6] Updating entry revision 18 "My first blog" ... done
plugindev-queue_v5-1 | > [5/6] Updating entry revision 20 "My first blog" ... done
plugindev-queue_v5-1 | > [6/6] Updating entry revision 20 "My first blog" ... done
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > update in {{%changedfields}} ... done (time: 0.006s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.003s)
plugindev-queue_v5-1 | > [1/2] Updating entry 2 "Homepage" ... done
plugindev-queue_v5-1 | > [2/2] Updating entry 2 "Homepage" ... done
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > update in {{%changedfields}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.005s)
plugindev-queue_v5-1 | > [1/2] Updating global set 19 ... done
plugindev-queue_v5-1 | > [2/2] Updating global set 19 ... done
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > update in {{%changedfields}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.003s)
plugindev-queue_v5-1 | > [1/1] Updating user 1 ... done
plugindev-queue_v5-1 | > update in {{%elements}} ... done (time: 0.001s)
plugindev-queue_v5-1 | > delete from {{%content}} ... done (time: 0.003s)
plugindev-queue_v5-1 | *** applied m230511_215903_content_refactor (time: 0.447s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230524_220029_global_entry_types
plugindev-queue_v5-1 | > dropping {{%sections_entrytypes}} if it exists ... done (time: 0.002s)
plugindev-queue_v5-1 | > create table {{%sections_entrytypes}} ... done (time: 0.023s)
plugindev-queue_v5-1 | > add foreign key fk_wwwnepzfjboecjuaqungnjumqglptihcmmrx: {{%sections_entrytypes}} (sectionId) references {{%sections}} (id) ... done (time: 0.080s)
plugindev-queue_v5-1 | > add foreign key fk_ljeqcphnnelorkorbzxzalqgknzxlidhxnxs: {{%sections_entrytypes}} (typeId) references {{%entrytypes}} (id) ... done (time: 0.113s)
plugindev-queue_v5-1 | > insert into {{%sections_entrytypes}} ... done (time: 0.019s)
plugindev-queue_v5-1 | > dropping foreign key on {{%entrytypes}} if it exists ... done (time: 0.052s)
plugindev-queue_v5-1 | > dropping index on {{%entrytypes}} if it exists ... done (time: 0.035s)
plugindev-queue_v5-1 | > dropping index on {{%entrytypes}} if it exists ... done (time: 0.047s)
plugindev-queue_v5-1 | > dropping index on {{%entrytypes}} if it exists ... done (time: 0.035s)
plugindev-queue_v5-1 | > drop column sectionId from table {{%entrytypes}} ... done (time: 0.031s)
plugindev-queue_v5-1 | > drop column sortOrder from table {{%entrytypes}} ... done (time: 0.027s)
plugindev-queue_v5-1 | *** applied m230524_220029_global_entry_types (time: 0.478s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230616_173810_kill_field_groups
plugindev-queue_v5-1 | > dropping all foreign keys to {{%fieldgroups}} ... done (time: 0.244s)
plugindev-queue_v5-1 | > drop column groupId from table {{%fields}} ... done (time: 0.098s)
plugindev-queue_v5-1 | > drop table {{%fieldgroups}} ... done (time: 0.035s)
plugindev-queue_v5-1 | *** applied m230616_173810_kill_field_groups (time: 0.391s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230616_183820_remove_field_name_limit
plugindev-queue_v5-1 | > alter column name in table {{%fields}} to text NOT NULL ... done (time: 0.083s)
plugindev-queue_v5-1 | *** applied m230616_183820_remove_field_name_limit (time: 0.096s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230617_070415_entrify_matrix_blocks
plugindev-queue_v5-1 | > alter column sectionId in table {{%entries}} to integer ... done (time: 0.109s)
plugindev-queue_v5-1 | > add column primaryOwnerId integer AFTER `parentId` to table {{%entries}} ... done (time: 0.038s)
plugindev-queue_v5-1 | > add column fieldId integer AFTER `primaryOwnerId` to table {{%entries}} ... done (time: 0.034s)
plugindev-queue_v5-1 | > add column deletedWithOwner boolean NULL DEFAULT NULL AFTER `dateDeleted` to table {{%elements}} ... done (time: 0.106s)
plugindev-queue_v5-1 | > create table {{%elements_owners}} ... done (time: 0.035s)
plugindev-queue_v5-1 | > create index idx_cleaogtdowypxcugevcbjgihjafecbovltor on {{%entries}} (primaryOwnerId) ... done (time: 0.058s)
plugindev-queue_v5-1 | > create index idx_wrebespbljaywzhpmuoaomjzzabnzndmfgzs on {{%entries}} (fieldId) ... done (time: 0.065s)
plugindev-queue_v5-1 | > add foreign key fk_aqlxpdvngdrzeenrthyegcfpgplbdeihgyry: {{%entries}} (fieldId) references {{%fields}} (id) ... done (time: 0.092s)
plugindev-queue_v5-1 | > add foreign key fk_xlhalrtisfktrjwmwkpovkkjfmqgqmubijma: {{%entries}} (primaryOwnerId) references {{%elements}} (id) ... done (time: 0.109s)
plugindev-queue_v5-1 | > add foreign key fk_bkogbqjlrrcipmzkzkdvbkrhyvujjochirms: {{%elements_owners}} (elementId) references {{%elements}} (id) ... done (time: 0.060s)
plugindev-queue_v5-1 | > add foreign key fk_duvfgsggestiyljymueucphtpmjcudxttxuv: {{%elements_owners}} (ownerId) references {{%elements}} (id) ... done (time: 0.078s)
plugindev-queue_v5-1 | > dropping all foreign keys to {{%matrixblocks_owners}} ... done (time: 0.195s)
plugindev-queue_v5-1 | > dropping all foreign keys to {{%matrixblocktypes}} ... done (time: 0.021s)
plugindev-queue_v5-1 | > drop table {{%matrixblocks_owners}} ... done (time: 0.016s)
plugindev-queue_v5-1 | > drop table {{%matrixblocks}} ... done (time: 0.022s)
plugindev-queue_v5-1 | > drop table {{%matrixblocktypes}} ... done (time: 0.048s)
plugindev-queue_v5-1 | *** applied m230617_070415_entrify_matrix_blocks (time: 1.117s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230904_190356_address_fields
plugindev-queue_v5-1 | > rename column ownerId in table {{%addresses}} to primaryOwnerId ... done (time: 0.021s)
plugindev-queue_v5-1 | > add column fieldId integer AFTER `primaryOwnerId` to table {{%addresses}} ... done (time: 0.027s)
plugindev-queue_v5-1 | *** applied m230904_190356_address_fields (time: 0.059s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m230928_144045_add_subpath_to_volumes
plugindev-queue_v5-1 | > add column subpath string AFTER `fs` to table {{%volumes}} ... done (time: 0.023s)
plugindev-queue_v5-1 | *** applied m230928_144045_add_subpath_to_volumes (time: 0.034s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m231013_185640_changedfields_amend_primary_key
plugindev-queue_v5-1 | > drop primary key elementId ... done (time: 0.075s)
plugindev-queue_v5-1 | > add primary key layoutUid on {{%changedfields}} (elementId,siteId,fieldId,layoutElementUid) ... done (time: 0.076s)
plugindev-queue_v5-1 | *** applied m231013_185640_changedfields_amend_primary_key (time: 0.166s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | *** applying m231213_030600_element_bulk_ops
plugindev-queue_v5-1 | > create table {{%elements_bulkops}} ... done (time: 0.033s)
plugindev-queue_v5-1 | > add foreign key fk_vhhqbcbrnzusffujfbksksuvlniztejjldzm: {{%elements_bulkops}} (elementId) references {{%elements}} (id) ... done (time: 0.051s)
plugindev-queue_v5-1 | > create index idx_qjbblihvirdrmusnofliedwdjccdyghuoowh on {{%elements_bulkops}} (timestamp) ... done (time: 0.017s)
plugindev-queue_v5-1 | *** applied m231213_030600_element_bulk_ops (time: 0.116s)
plugindev-queue_v5-1 |
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | 14 migrations were applied.
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | Migrated up successfully.
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | Your project config files were created for different versions of Craft and/or plugins than what’s currently installed.
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | Craft CMS is installed with schema version of 5.0.0.12 while 5.0.0.10 was expected.
plugindev-queue_v5-1 |
plugindev-queue_v5-1 | Try running `composer install` from your terminal to resolve.
That Invalid field layout element class
warning can happen in Craft 3/4 as well. It occurs if you have a field layout element that was defined by a nonexistent class (in this case, craft\commerce\fieldlayoutelements\ProductTitleField
). It’s harmless though.
Craft 5.0.0-alpha.2 is out with that fix.
What happened?
Description
Whilst running
php craft up
on a minimal Craft 4.x db/install, the migrationm230511_215903_content_refactor
fails:The MySQL db dump is here: https://github.com/nystudio107/plugindev/blob/develop/db-seed/mysql/dbs/project_v5.sql
A similar error occurs when using the Postgres db dump here: https://github.com/nystudio107/plugindev/blob/develop/db-seed/postgres/dbs/project_v5.sql
Both dumps are from the latest version of Craft 4, from a working install.
Steps to reproduce
craftcms/cms
^5.0.0-alpha.1
php craft up
Expected behavior
It would successfully update to Craft 5
Actual behavior
Multiple exceptions are thrown during the migration
Craft CMS version
5.0.0-alpha.1
PHP version
8.2
Operating system and version
n/a
Database type and version
MySQL & Postgres
Image driver and version
n/a
Installed plugins and versions
n/a