Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update to craft 3.1 - Migration failed #3662

Closed
elodiegrondin opened this issue Jan 18, 2019 · 3 comments
Closed

Unable to update to craft 3.1 - Migration failed #3662

elodiegrondin opened this issue Jan 18, 2019 · 3 comments

Comments

@elodiegrondin
Copy link

Description

I updated my local website to craft 3.1.1. Everything seems to work perfectly however when I want to do the same on my staging website, the update is failing.

I receive a missing class error during a migration but I don't understand where this migration comes from I don't have it in my migrations folder. Plus, I no longer use the sprout form plugin anymore so it's might be normal that the class has disappeared.

I uninstalled sprout form but got an error so maybe it's not deleted properly. So I tried to remove every sprout form table present in my database but still got the same error message.

Une des migrations de Craft CMS a échoué.

Error: Class 'barrelstrength\sproutforms\fields\Forms' not found

Migration: craft\migrations\m190108_113000_asset_field_setting_change

Output:

Exception: Class 'barrelstrength\sproutforms\fields\Forms' not found (/www/htdocs/w018e13a/vendor/craftcms/cms/src/services/Fields.php:1410)
#0 /www/htdocs/w018e13a/vendor/craftcms/cms/src/services/Matrix.php(369): craft\services\Fields->applyFieldSave('52ba3b54-9382-4...', Array, 'matrixBlockType...')
#1 /www/htdocs/w018e13a/vendor/craftcms/cms/src/services/ProjectConfig.php(783): craft\services\Matrix->handleChangedBlockType(Object(craft\events\ConfigEvent))
#2 [internal function]: craft\services\ProjectConfig->craft\services\{closure}(Object(craft\events\ConfigEvent))
#3 /www/htdocs/w018e13a/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Object(Closure), Object(craft\events\ConfigEvent))
#4 /www/htdocs/w018e13a/vendor/craftcms/cms/src/services/ProjectConfig.php(481): yii\base\Component->trigger('addItem', Object(craft\events\ConfigEvent))
#5 /www/htdocs/w018e13a/vendor/craftcms/cms/src/services/ProjectConfig.php(335): craft\services\ProjectConfig->processConfigChanges('matrixBlockType...', true)
#6 /www/htdocs/w018e13a/vendor/craftcms/cms/src/migrations/m190108_113000_asset_field_setting_change.php(69): craft\services\ProjectConfig->set('matrixBlockType...', Array)
#7 /www/htdocs/w018e13a/vendor/craftcms/cms/src/db/Migration.php(56): craft\migrations\m190108_113000_asset_field_setting_change->safeUp()
#8 /www/htdocs/w018e13a/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
#9 /www/htdocs/w018e13a/vendor/craftcms/cms/src/db/MigrationManager.php(163): craft\db\MigrationManager->migrateUp(Object(craft\migrations\m190108_113000_asset_field_setting_change))
#10 /www/htdocs/w018e13a/vendor/craftcms/cms/src/services/Updates.php(215): craft\db\MigrationManager->up()
#11 /www/htdocs/w018e13a/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(445): craft\services\Updates->runMigrations(Array)
#12 /www/htdocs/w018e13a/vendor/craftcms/cms/src/controllers/UpdaterController.php(208): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#13 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#14 /www/htdocs/w018e13a/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /www/htdocs/w018e13a/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#16 /www/htdocs/w018e13a/vendor/craftcms/cms/src/web/Controller.php(109): yii\base\Controller->runAction('migrate', Array)
#17 /www/htdocs/w018e13a/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#18 /www/htdocs/w018e13a/vendor/craftcms/cms/src/web/Application.php(297): yii\base\Module->runAction('updater/migrate', Array)
#19 /www/htdocs/w018e13a/vendor/craftcms/cms/src/web/Application.php(683): craft\web\Application->runAction('updater/migrate')
#20 /www/htdocs/w018e13a/vendor/craftcms/cms/src/web/Application.php(223): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#21 /www/htdocs/w018e13a/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#22 /www/htdocs/w018e13a/htdocs/index.php(21): yii\base\Application->run()
#23 {main}

Debug

  1. I tried to do the update via ftp: Replacing vendor folder and composer files (and removing sprout form tables)
  2. I tried to do the update in the cp too but failed.

Additional info

  • Craft version: 3.0.36
  • PHP version: 7.2.13
  • Database driver & version: MySQL 5.6.38

I'm stuck, I do not see how to install this update without this mysterious migration interferes...

@andris-sevcenko
Copy link
Contributor

There's likely a Sprout Forms field somewhere in a Matrix block that might be orphaned and invisible in the CP. It is as convoluted as it sounds.

We have a solution in mind for issues like this when migrating and I hope to implement that today.

andris-sevcenko added a commit that referenced this issue Jan 18, 2019
@brandonkelly
Copy link
Member

We couldn’t get to the fix for this in 3.1.2 but we’ve found that the issue can be circumvented by upgrading to 3.0.37 first: https://docs.craftcms.com/v3/upgrade.html#performing-the-upgrade

@elodiegrondin
Copy link
Author

Yes indeed, I found the orphaned sprout forms field.
Thanks for the tips, I'll try it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants