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

Migrations failed #1687

Open
darylknight opened this issue Dec 16, 2024 · 0 comments
Open

Migrations failed #1687

darylknight opened this issue Dec 16, 2024 · 0 comments
Labels
issue Something isn't working correctly

Comments

@darylknight
Copy link

What happened?

Stack trace is below. I was trying to update Freeform from 5.6.8 to 5.8.2

Errors and Stack Trace (if available)

❯ ddev craft update freeform
Fetching available updates ... done
Performing one update:

    - freeform 5.6.8 => 5.8.2

Create database backup? (yes|no) [yes]:
Backing up the database ... done
Performing update with Composer ... done
Applying new migrations ... error: The command "'/usr/bin/php8.2' '/var/www/html/craft' 'migrate/all' '--no-backup' '--no-content'" failed.

Exit Code: 1(General error)

Working directory: /var/www/html

Output:
================
Checking for pending Craft and plugin migrations ...
Total 5 new Freeform migrations to be applied:
    - m240819_104209_AddTranslationTable
    - m241023_080038_AddPdfTemplateTable
    - m241104_091432_AddOptionsToIntegrationFields
    - m241126_113656_UpdateTableLayoutProperties
    - m241210_054218_AddOptionColumnFixForIntegrations

*** applying m240819_104209_AddTranslationTable
    > create table {{%freeform_forms_translations}} ... done (time: 0.020s)
    > create unique index idx_abiiscsrvoikqjdyldptdctwvwxcjxlpeliz on {{%freeform_forms_translations}} (formId,siteId) ... done (time: 0.015s)
    > add foreign key fk_vqfjproxtjctwhpyhwqtqljllzuwuuharylc: {{%freeform_forms_translations}} (formId) references {{%freeform_forms}} (id) ... done (time: 0.047s)
    > add foreign key fk_ubodnvqslagfgmbnskddsdwdlqfbzfgxqbhs: {{%freeform_forms_translations}} (siteId) references {{%sites}} (id) ... done (time: 0.048s)
*** applied m240819_104209_AddTranslationTable (time: 0.136s)

*** applying m241023_080038_AddPdfTemplateTable
    > create table {{%freeform_pdf_templates}} ... done (time: 0.023s)
    > add column pdfTemplateIds text AFTER `id` to table {{%freeform_notification_templates}} ... done (time: 0.009s)
*** applied m241023_080038_AddPdfTemplateTable (time: 0.037s)

*** applying m241104_091432_AddOptionsToIntegrationFields
    > add column options json AFTER `required` to table {{%freeform_crm_fields}} ... done (time: 0.007s)
    > add column options json AFTER `required` to table {{%freeform_email_marketing_fields}} ... done (time: 0.008s)
*** applied m241104_091432_AddOptionsToIntegrationFields (time: 0.022s)

*** applying m241126_113656_UpdateTableLayoutProperties
Exception: Undefined array key "type" (/var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/migrations/m241126_113656_UpdateTableLayoutProperties.php:32)
#0 /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/migrations/m241126_113656_UpdateTableLayoutProperties.php(32): yii\base\ErrorHandler->handleError(2, 'Undefined array...', '/var/www/html/v...', 32)
#1 /var/www/html/vendor/craftcms/cms/src/db/Migration.php(50): Solspace\Freeform\migrations\m241126_113656_UpdateTableLayoutProperties->safeUp()
#2 /var/www/html/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
#3 /var/www/html/vendor/craftcms/cms/src/console/controllers/MigrateController.php(361): yii\console\controllers\BaseMigrateController->migrateUp('m241126_113656_...')
#4 [internal function]: craft\console\controllers\MigrateController->actionAll()
#5 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#6 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#7 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
#8 /var/www/html/vendor/craftcms/cms/src/console/ControllerTrait.php(90): yii\console\Controller->runAction('all', Array)
#9 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
#10 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#11 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
#12 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#13 /var/www/html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
#14 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
#15 /var/www/html/craft(13): yii\base\Application->run()
#16 {main}
*** failed to apply m241126_113656_UpdateTableLayoutProperties (time: 0.001s)


3 from 5 migrations were applied.

Migration failed. The rest of the migrations are canceled.

Restore a database backup before trying again.


Error Output:
================


Output:

Checking for pending Craft and plugin migrations ...
Total 5 new Freeform migrations to be applied:
    - m240819_104209_AddTranslationTable
    - m241023_080038_AddPdfTemplateTable
    - m241104_091432_AddOptionsToIntegrationFields
    - m241126_113656_UpdateTableLayoutProperties
    - m241210_054218_AddOptionColumnFixForIntegrations

*** applying m240819_104209_AddTranslationTable
    > create table {{%freeform_forms_translations}} ... done (time: 0.020s)
    > create unique index idx_abiiscsrvoikqjdyldptdctwvwxcjxlpeliz on {{%freeform_forms_translations}} (formId,siteId) ... done (time: 0.015s)
    > add foreign key fk_vqfjproxtjctwhpyhwqtqljllzuwuuharylc: {{%freeform_forms_translations}} (formId) references {{%freeform_forms}} (id) ... done (time: 0.047s)
    > add foreign key fk_ubodnvqslagfgmbnskddsdwdlqfbzfgxqbhs: {{%freeform_forms_translations}} (siteId) references {{%sites}} (id) ... done (time: 0.048s)
*** applied m240819_104209_AddTranslationTable (time: 0.136s)

*** applying m241023_080038_AddPdfTemplateTable
    > create table {{%freeform_pdf_templates}} ... done (time: 0.023s)
    > add column pdfTemplateIds text AFTER `id` to table {{%freeform_notification_templates}} ... done (time: 0.009s)
*** applied m241023_080038_AddPdfTemplateTable (time: 0.037s)

*** applying m241104_091432_AddOptionsToIntegrationFields
    > add column options json AFTER `required` to table {{%freeform_crm_fields}} ... done (time: 0.007s)
    > add column options json AFTER `required` to table {{%freeform_email_marketing_fields}} ... done (time: 0.008s)
*** applied m241104_091432_AddOptionsToIntegrationFields (time: 0.022s)

*** applying m241126_113656_UpdateTableLayoutProperties
Exception: Undefined array key "type" (/var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/migrations/m241126_113656_UpdateTableLayoutProperties.php:32)
#0 /var/www/html/vendor/solspace/craft-freeform/packages/plugin/src/migrations/m241126_113656_UpdateTableLayoutProperties.php(32): yii\base\ErrorHandler->handleError(2, 'Undefined array...', '/var/www/html/v...', 32)
#1 /var/www/html/vendor/craftcms/cms/src/db/Migration.php(50): Solspace\Freeform\migrations\m241126_113656_UpdateTableLayoutProperties->safeUp()
#2 /var/www/html/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
#3 /var/www/html/vendor/craftcms/cms/src/console/controllers/MigrateController.php(361): yii\console\controllers\BaseMigrateController->migrateUp('m241126_113656_...')
#4 [internal function]: craft\console\controllers\MigrateController->actionAll()
#5 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#6 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#7 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('all', Array)
#8 /var/www/html/vendor/craftcms/cms/src/console/ControllerTrait.php(90): yii\console\Controller->runAction('all', Array)
#9 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\controllers\MigrateController->runAction('all', Array)
#10 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#11 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('migrate/all', Array)
#12 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#13 /var/www/html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
#14 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
#15 /var/www/html/craft(13): yii\base\Application->run()
#16 {main}
*** failed to apply m241126_113656_UpdateTableLayoutProperties (time: 0.001s)


3 from 5 migrations were applied.

Migration failed. The rest of the migrations are canceled.

Restore a database backup before trying again.

How can we reproduce this?

Upgrade Freeform from 5.6.8 to 5.8.2

Freeform Edition

Pro

Freeform Version

5.8.2

Craft Version

4.13.6

When did this issue start?

After upgrading from older Freeform version

Previous Freeform Version

5.6.8

@darylknight darylknight added the issue Something isn't working correctly label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

No branches or pull requests

1 participant