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

[3.x]: Upgrade to Craft 4 #13130

Closed
DenyEs opened this issue Apr 27, 2023 · 5 comments
Closed

[3.x]: Upgrade to Craft 4 #13130

DenyEs opened this issue Apr 27, 2023 · 5 comments
Assignees

Comments

@DenyEs
Copy link

DenyEs commented Apr 27, 2023

What happened?

Description

I followed the upgrade guide on the website. I am on the latest version of Craft, I ran 'php craft project-config/rebuild', changed version of all plugins and craft. When I run 'composer update' everything is fine, but the second I run 'php craft migrate/all' I get the following error.

The SQL being executed was: SELECT id, name, handle, fs, transformFs, transformSubpath, titleTranslationMethod, titleTranslationKeyFormat, sortOrder, fieldLayoutId, uid
FROM craft_volumes
WHERE dateDeleted IS NULL
ORDER BY sortOrder'

It's missing a couple of fields from the volumes table as those did not exists withing Craft 3 but I don't think I should create them manually.

Does anyone have an idea as to what's happening or whether I missed a step (I tried twice).

Expected behavior

When I run 'php craft migrate/all' it migrates all it needs and the sites comes up

Actual behavior

Throws an error when running migrations.

Craft CMS version

3.8.8

PHP version

8.1.11

Operating system and version

Mac OS Ventura 13.3

Database type and version

MySQL 8.0.30

Image driver and version

No response

Installed plugins and versions

    "ext-curl": "*",
    "ext-json": "*",
    "amici/craft-super-pdf": "^2.0",
    "craftcms/aws-s3": "^2.0",
    "craftcms/cms": "^4.4",
    "craftcms/element-api": "^3.0",
    "craftcms/feed-me": "^5.1.0",
    "craftcms/redactor": "^3.0",
    "dolphiq/redirect": "^2.0",
    "ether/simplemap": "^4.0",
    "guzzlehttp/guzzle": "^7.4",
    "hybridinteractive/craft-position-fieldtype": "4.0",
    "lewisjenkins/craft-dynamic-fields": "^4.0",
    "miranj/craft-obfuscator": "^1.1",
    "mmikkel/cp-field-inspect": "^1.2",
    "nystudio107/craft-cookies": "^4.0",
    "nystudio107/craft-eagerbeaver": "^4.0",
    "presseddigital/linkit": "^4.0",
    "putyourlightson/craft-elements-panel": "^2.0",
    "solspace/craft-freeform": "^4.0",
    "spacecatninja/imager-x": "^4.1",
    "spicyweb/craft-embedded-assets": "^3.1",
    "studioespresso/craft-dumper": "^3.0",
    "studioespresso/craft-scout": "^3.1",
    "superbig/craft3-mobiledetect": "^2.0",
    "superbig/craft3-templateselect": "3.0",
    "topshelfcraft/wordsmith": "^4.0",
    "trendyminds/algolia": "^4.0",
    "verbb/buttonbox": "^4.2",
    "verbb/cloner": "^2.0",
    "verbb/default-dashboard": "^2.0",
    "verbb/super-table": "^3.0",
    "verbb/tablemaker": "^4.0",
    "vlucas/phpdotenv": "^5.4.0"
@brandonkelly
Copy link
Member

There should have been a stack trace that was also output alongside the error. Can you please post it here?

(If there wasn’t a stack trace, search your config/storage/logs/ folder for the same error. There should definitely be a stack trace in there.)

@DenyEs
Copy link
Author

DenyEs commented Apr 28, 2023

Sure, here is the stack trace

Exception 'yii\db\Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fs' in 'field list'
The SQL being executed was: SELECT `id`, `name`, `handle`, `fs`, `transformFs`, `transformSubpath`, `titleTranslationMethod`, `titleTranslationKeyFormat`, `sortOrder`, `fieldLayoutId`, `uid`
FROM `craft_volumes`
WHERE `dateDeleted` IS NULL
ORDER BY `sortOrder`'

in /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Schema.php:676

Error Info:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'fs' in 'field list'
)

Caused by: Exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fs' in 'field list''

in /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Command.php:1302

Stack trace:
#0 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT `id`, `n...')
#2 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/db/Query.php(248): yii\db\Query->all(NULL)
#5 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Volumes.php(164): craft\db\Query->all()
#6 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Volumes.php(240): craft\services\Volumes->_volumes()
#7 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/elements/db/AssetQuery.php(315): craft\services\Volumes->getVolumeByHandle('files')
#8 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/helpers/Db.php(927): craft\elements\db\AssetQuery->craft\elements\db\{closure}('files')
#9 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/helpers/Db.php(908): craft\helpers\Db::normalizeParam(Array, Object(Closure))
#10 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/elements/db/AssetQuery.php(318): craft\helpers\Db::normalizeParam('files', Object(Closure))
#11 /Users/deny/Documents/sites/website/config/scout.php(199): craft\elements\db\AssetQuery->volume('files')
#12 /Users/deny/Documents/sites/website/vendor/studioespresso/craft-scout/src/ScoutIndex.php(56): craft\services\Config->{closure}(Object(craft\elements\db\AssetQuery))
#13 /Users/deny/Documents/sites/website/config/scout.php(200): rias\scout\ScoutIndex->criteria(Object(Closure))
#14 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Config.php(289): include('/Users/denismek...')
#15 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Config.php(281): craft\services\Config->_configFromFileInternal('/Users/denismek...')
#16 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Plugins.php(934): craft\services\Config->getConfigFromFile('scout')
#17 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/services/Plugins.php(228): craft\services\Plugins->createPlugin('scout', Array)
#18 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/base/ApplicationTrait.php(1554): craft\services\Plugins->loadPlugins()
#19 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/console/Application.php(52): craft\console\Application->_postInit()
#20 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#21 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct(Array)
#22 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#23 [internal function]: yii\console\Application->__construct(Array)
#24 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#25 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\console\\A...', Array, Array)
#26 /Users/deny/Documents/sites/website/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\console\\A...', Array, Array)
#27 /Users/deny/Documents/sites/website/vendor/craftcms/cms/src/Craft.php(54): yii\BaseYii::createObject(Array, Array)
#28 /Users/deny/Documents/sites/website/vendor/craftcms/cms/bootstrap/bootstrap.php(252): Craft::createObject(Array)
#29 /Users/deny/Documents/sites/website/vendor/craftcms/cms/bootstrap/console.php(40): require('/Users/denismek...')
#30 /Users/deny/Documents/sites/website/craft(12): require('/Users/denismek...')
#31 {main}

@brandonkelly brandonkelly self-assigned this Apr 28, 2023
@brandonkelly
Copy link
Member

Thanks! This is now fixed for the next release.

You can get the fix now by changing your craftcms/cms requirement in composer.json to "dev-develop#bc46f3d6240b05a19e8989b0de8a1432ebc24dab as 4.4.8", and running composer update.

@DenyEs
Copy link
Author

DenyEs commented Apr 28, 2023

Awesome! Thanks Brandon.

@brandonkelly
Copy link
Member

Craft 4.4.9 is out with that migration fix.

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

No branches or pull requests

2 participants