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

Unknown column 'config' in 'field list' on Craft 2 -> 3 upgrade #5391

Closed
timkelty opened this issue Jan 2, 2020 · 22 comments
Closed

Unknown column 'config' in 'field list' on Craft 2 -> 3 upgrade #5391

timkelty opened this issue Jan 2, 2020 · 22 comments
Assignees

Comments

@timkelty
Copy link
Contributor

timkelty commented Jan 2, 2020

Steps to reproduce

  1. Import a craft 2 database into a craft 3.4.x codebase
  2. run craft migrate/all to start upgrade
Exception 'yii\db\Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'
The SQL being executed was: SELECT `config`
FROM `craft_info`
LIMIT 1'

in /app/vendor/composer/yiisoft/yii2/db/Schema.php:674

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

Stack trace:
#0 /app/vendor/composer/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'SELECT `config`...')
#1 /app/vendor/composer/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT `config`...')
#2 /app/vendor/composer/yiisoft/yii2/db/Command.php(425): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /app/vendor/composer/yiisoft/yii2/db/Query.php(291): yii\db\Command->queryScalar()
#4 /app/vendor/composer/craftcms/cms/src/db/Query.php(197): yii\db\Query->scalar(NULL)
#5 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(1436): craft\db\Query->scalar()
#6 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(360): craft\services\ProjectConfig->_getInternalConfigValue('system.timeZone')
#7 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\ProjectConfig->get('system.timeZone')
#8 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1333): craft\console\Application->_setTimeZone()
#9 /app/vendor/composer/craftcms/cms/src/console/Application.php(63): craft\console\Application->_preInit()
#10 /app/vendor/composer/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#11 /app/vendor/composer/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#12 /app/vendor/composer/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#13 /app/vendor/composer/craftcms/cms/src/console/Application.php(54): yii\console\Application->__construct(Array)
#14 [internal function]: craft\console\Application->__construct(Array)
#15 /app/vendor/composer/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#16 /app/vendor/composer/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\console\\A...', Array, Array)
#17 /app/vendor/composer/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\console\\A...', Array, Array)
#18 /app/vendor/composer/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject(Array)
#19 /app/vendor/composer/craftcms/cms/bootstrap/console.php(34): require('/app/vendor/com...')
#20 /app/bin/craft(6): require('/app/vendor/com...')
#21 {main}
[2020-01-02 20:03:11] craftcms.ERROR: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list' in /app/vendor/composer/yiisoft/yii2/db/Command.php:1290 Stack trace: #0 /app/vendor/composer/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute() #1 /app/vendor/composer/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT `config`...') #2 /app/vendor/composer/yiisoft/yii2/db/Command.php(425): yii\db\Command->queryInternal('fetchColumn', 0) #3 /app/vendor/composer/yiisoft/yii2/db/Query.php(291): yii\db\Command->queryScalar() #4 /app/vendor/composer/craftcms/cms/src/db/Query.php(197): yii\db\Query->scalar(NULL) #5 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(1436): craft\db\Query->scalar() #6 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(360): craft\services\ProjectConfig->_getInternalConfigValue('system.timeZone') #7 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\ProjectConfig->get('system.timeZone') #8 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1333): craft\console\Application->_setTimeZone() #9 /app/vendor/composer/craftcms/cms/src/console/Application.php(63): craft\console\Application->_preInit() #10 /app/vendor/composer/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init() #11 /app/vendor/composer/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array) #12 /app/vendor/composer/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array) #13 /app/vendor/composer/craftcms/cms/src/console/Application.php(54): yii\console\Application->__construct(Array) #14 [internal function]: craft\console\Application->__construct(Array) #15 /app/vendor/composer/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array) #16 /app/vendor/composer/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\console\\A...', Array, Array) #17 /app/vendor/composer/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\console\\A...', Array, Array) #18 /app/vendor/composer/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject(Array) #19 /app/vendor/composer/craftcms/cms/bootstrap/console.php(34): require('/app/vendor/com...') #20 /app/bin/craft(6): require('/app/vendor/com...') #21 {main}  Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list' The SQL being executed was: SELECT `config` FROM `craft_info` LIMIT 1 in /app/vendor/composer/yiisoft/yii2/db/Schema.php:674 Stack trace: #0 /app/vendor/composer/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'SELECT `config`...') #1 /app/vendor/composer/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT `config`...') #2 /app/vendor/composer/yiisoft/yii2/db/Command.php(425): yii\db\Command->queryInternal('fetchColumn', 0) #3 /app/vendor/composer/yiisoft/yii2/db/Query.php(291): yii\db\Command->queryScalar() #4 /app/vendor/composer/craftcms/cms/src/db/Query.php(197): yii\db\Query->scalar(NULL) #5 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(1436): craft\db\Query->scalar() #6 /app/vendor/composer/craftcms/cms/src/services/ProjectConfig.php(360): craft\services\ProjectConfig->_getInternalConfigValue('system.timeZone') #7 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\ProjectConfig->get('system.timeZone') #8 /app/vendor/composer/craftcms/cms/src/base/ApplicationTrait.php(1333): craft\console\Application->_setTimeZone() #9 /app/vendor/composer/craftcms/cms/src/console/Application.php(63): craft\console\Application->_preInit() #10 /app/vendor/composer/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init() #11 /app/vendor/composer/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array) #12 /app/vendor/composer/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array) #13 /app/vendor/composer/craftcms/cms/src/console/Application.php(54): yii\console\Application->__construct(Array) #14 [internal function]: craft\console\Application->__construct(Array) #15 /app/vendor/composer/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array) #16 /app/vendor/composer/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\console\\A...', Array, Array) #17 /app/vendor/composer/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\console\\A...', Array, Array) #18 /app/vendor/composer/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject(Array) #19 /app/vendor/composer/craftcms/cms/bootstrap/console.php(34): require('/app/vendor/com...') #20 /app/bin/craft(6): require('/app/vendor/com...') #21 {main} Additional Information: Array (     [0] => 42S22     [1] => 1054     [2] => Unknown column 'config' in 'field list' )  {"trace":[],"memory":14947848,"category":"yii\\db\\Exception","exception":"[object] (yii\\db\\Exception(code: 42): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'\nThe SQL being executed was: SELECT `config`\nFROM `craft_info`\nLIMIT 1 at /app/vendor/composer/yiisoft/yii2/db/Schema.php:674, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list' at /app/vendor/composer/yiisoft/yii2/db/Command.php:1290)"} []
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional info

  • Craft version:
            "version": "3.4.x-dev",
            "source": {
                "type": "git",
                "url": "https://github.com/craftcms/cms.git",
                "reference": "8a355e239c18849fc240c2998895f86de0582dd7"
            },
@timkelty timkelty changed the title Unknown column 'config' in 'field list' on Craft 2 upgrade Unknown column 'config' in 'field list' on Craft 2 -> 3 upgrade Jan 2, 2020
@timkelty
Copy link
Contributor Author

timkelty commented Jan 2, 2020

I seem to be able to coax it into working by setting a timezone in my config/general.php, and setting a default column value for siteName and siteUrl in the info table of my Craft 2 db.

UPDATE: it got a little further but still barfed looking for a config column.

@andris-sevcenko
Copy link
Contributor

This exact issue is resolved now on the 3.4 branch. However, there's a different error preventing upgrading now. Going to open a new issue for that.

@laurabennett
Copy link

I'm getting this same error updating from 3.3.3.20 to 3.4.
Database Exception – yii\db\Exception
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'
The SQL being executed was: SELECT config
FROM info
LIMIT 1
Error Info: Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'config' in 'field list'
)

Caused by: PDOException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'
in C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Command.php at line 1290

Should I open a new issue?

@msiemens
Copy link

I'm getting this same error updating from 3.3.3.20 to 3.4.

Same for me!

@msiemens
Copy link

Seems like this issue occurs after migrations fail due failure of changing the project config because of read-only mode:

    > create table {{%projectconfig}} ... done (time: 0.004s)
    > batch insert into {{%projectconfig}} ... done (time: 0.005s)
    > batch insert into {{%projectconfig}} ... done (time: 0.003s)
    > batch insert into {{%projectconfig}} ... done (time: 0.003s)
    > batch insert into {{%projectconfig}} ... done (time: 0.002s)
    > batch insert into {{%projectconfig}} ... done (time: 0.002s)
    > batch insert into {{%projectconfig}} ... done (time: 0.002s)
    > batch insert into {{%projectconfig}} ... done (time: 0.004s)
    > batch insert into {{%projectconfig}} ... done (time: 0.004s)
    > batch insert into {{%projectconfig}} ... done (time: 0.004s)
    > batch insert into {{%projectconfig}} ... done (time: 0.003s)
    > batch insert into {{%projectconfig}} ... done (time: 0.004s)
    > batch insert into {{%projectconfig}} ... done (time: 0.003s)
    > batch insert into {{%projectconfig}} ... done (time: 0.002s)
    > drop column config from table {{%info}} ... done (time: 0.012s)
Exception: Changes to the project config are not possible while in read-only mode. (vendor/craftcms/cms/src/services/ProjectConfig.php:437)

@brandonkelly
Copy link
Member

Can either of you find that error in your storage/logs/web.log file (or one of the older versions of web.log below it), and post the stack trace leading up to the error?

@timkelty
Copy link
Contributor Author

I had the same thing, but then updated to the latest 3.4x and all was well

@brandonkelly brandonkelly reopened this Jan 28, 2020
@laurabennett
Copy link

laurabennett commented Jan 28, 2020

I'm on dev environment so I don't think it's in read-only mode. Does this help or would you like the entire file?

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'
The SQL being executed was: SELECT `config`
FROM `info`
LIMIT 1 in C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Schema.php:674
Stack trace:
#0 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'SELECT `config`...')
#1 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Command.php(1158): yii\db\Command->internalExecute('SELECT `config`...')
#2 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Command.php(425): yii\db\Command->queryInternal('fetchColumn', 0)
#3 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\db\Query.php(291): yii\db\Command->queryScalar()
#4 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\db\Query.php(188): yii\db\Query->scalar(NULL)
#5 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\services\ProjectConfig.php(1710): craft\db\Query->scalar()
#6 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\services\ProjectConfig.php(1604): craft\services\ProjectConfig->_loadInternalConfigData()
#7 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\services\ProjectConfig.php(1593): craft\services\ProjectConfig->_getStoredConfig()
#8 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\services\ProjectConfig.php(397): craft\services\ProjectConfig->_getLoadedConfig()
#9 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\base\ApplicationTrait.php(1375): craft\services\ProjectConfig->get('system.timeZone')
#10 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\base\ApplicationTrait.php(1333): craft\web\Application->_setTimeZone()
#11 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\web\Application.php(100): craft\web\Application->_preInit()
#12 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\base\BaseObject.php(109): craft\web\Application->init()
#13 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\base\Application.php(206): yii\base\BaseObject->__construct(Array)
#14 C:\laragon\www\cherryhill\vendor\craftcms\cms\src\web\Application.php(91): yii\base\Application->__construct('[<span class="s...')
#15 [internal function]: craft\web\Application->__construct(Array)
#16 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\di\Container.php(400): ReflectionClass->newInstanceArgs(Array)
#17 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\di\Container.php(159): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#18 C:\laragon\www\cherryhill\vendor\yiisoft\yii2\BaseYii.php(365): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#19 C:\laragon\www\cherryhill\vendor\craftcms\cms\bootstrap\bootstrap.php(245): yii\BaseYii::createObject(Array)
#20 C:\laragon\www\cherryhill\vendor\craftcms\cms\bootstrap\web.php(51): require('C:\\laragon\\www\\...')
#21 C:\laragon\www\cherryhill\web\index.php(20): require('C:\\laragon\\www\\...')
#22 {main}
Additional Information:
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'config' in 'field list'
)

@msiemens
Copy link

Can either of you find that error in your storage/logs/web.log file (or one of the older versions of web.log below it), and post the stack trace leading up to the error?

For me it was in console.log:

2020-01-28 19:59:36 [-][-][-][error][craft\errors\MigrateException] yii\base\NotSupportedException: Changes to the project config are not possible while in read-only mode. in vendor/craftcms/cms/src/services/ProjectConfig.php:437
Stack trace:
#0 vendor/craftcms/cms/src/migrations/m190913_152146_update_preview_targets.php(54): craft\services\ProjectConfig->set()
#1 vendor/craftcms/cms/src/db/Migration.php(52): craft\migrations\m190913_152146_update_preview_targets->safeUp()
#2 vendor/craftcms/cms/src/db/MigrationManager.php(233): craft\db\Migration->up()
#3 vendor/craftcms/cms/src/db/MigrationManager.php(153): craft\db\MigrationManager->migrateUp()
#4 vendor/craftcms/cms/src/services/Updates.php(225): craft\db\MigrationManager->up()
#5 vendor/craftcms/cms/src/console/controllers/MigrateController.php(255): craft\services\Updates->runMigrations()
#6 [internal function]: craft\console\controllers\MigrateController->actionAll()
#7 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#8 vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#9 vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction()
#10 vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction()
#11 vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#12 vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction()
#13 vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()
#14 vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest()
#15 craft(24): yii\base\Application->run()
#16 {main}

This was on the first run of the migration. When running the migration again it was:

Column not found: 1054 Unknown column 'config' in 'field list' in vendor/yiisoft/yii2/db/Command.php:1290
Stack trace:
#0 vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute()
#1 vendor/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute()
#2 vendor/yiisoft/yii2/db/Command.php(425): yii\db\Command->queryInternal()
#3 vendor/yiisoft/yii2/db/Query.php(291): yii\db\Command->queryScalar()
#4 vendor/craftcms/cms/src/db/Query.php(188): yii\db\Query->scalar()
#5 vendor/craftcms/cms/src/services/ProjectConfig.php(1710): craft\db\Query->scalar()
#6 vendor/craftcms/cms/src/services/ProjectConfig.php(1604): craft\services\ProjectConfig->_loadInternalConfigData()
#7 vendor/craftcms/cms/src/services/ProjectConfig.php(1593): craft\services\ProjectConfig->_getStoredConfig()
#8 vendor/craftcms/cms/src/services/ProjectConfig.php(397): craft\services\ProjectConfig->_getLoadedConfig()
#9 vendor/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\ProjectConfig->get()
#10 vendor/craftcms/cms/src/base/ApplicationTrait.php(1333): craft\console\Application->_setTimeZone()
#11 vendor/craftcms/cms/src/console/Application.php(57): craft\console\Application->_preInit()
#12 vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#13 vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct()
#14 vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct()
#15 vendor/craftcms/cms/src/console/Application.php(48): yii\console\Application->__construct()
#16 [internal function]: craft\console\Application->__construct()
#17 vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs()
#18 vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build()
#19 vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
#20 vendor/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject()
#21 vendor/craftcms/cms/bootstrap/console.php(43): require('/mnt/web309/c0/...')
#22 craft(23): require('/mnt/web309/c0/...')
#23 {main}

@craftcms craftcms deleted a comment from TheFunkyMonk Jan 28, 2020
@msiemens
Copy link

msiemens commented Jan 28, 2020

I think I got it: When running the m190913_152146_update_preview_targets migration, it tries to change the project config:

$projectConfig->set("sections.{$uid}.previewTargets", $previewTargets);

This fails for me because on allowAdminChanges is set to false. Thus the upgrade of Craft fails and it thinks it's still on version 3.3.x. But then reading the project config in craft\services\ProjectConfig fails:

if (Craft::$app->getIsInstalled() && version_compare(Craft::$app->getInfo()->schemaVersion, '3.4.4', '<')) {
$config = (new Query())
->select(['config'])
->from([Table::INFO])
->scalar();
if ($config) {
// Try to decode it in case it contains any 4+ byte characters
$config = StringHelper::decdec($config);
if (strpos($config, '{') === 0) {
$data = Json::decode($config);
} else {
$data = Json::decode($config);
}
}
return $data;
}

This fails because the migration to move the project config to the projectconfig table has already been executed even though the upgrade to v3.4 failed.

EDIT: I commented out the lines from ProjectConfig.php and re-ran the migrations and it worked and the upgrade to v3.4 was successful.

@brandonkelly
Copy link
Member

@laurabennett Any chance you can send us your composer.json and composer.lock files, plus a database backup from before your update, over to support@craftcms.com ?

@brandonkelly
Copy link
Member

This fails for me because on allowAdminChanges is set to false. Thus the upgrade of Craft fails and it thinks it's still on version 3.3.x. But then reading the project config in craft\services\ProjectConfig fails:

@msiemens When allowAdminChanges => false, it’s expected that you are on an environment where updates are deployed along with new config/project.yaml files, which would have prevented that code from running in the first place.

// Don't make the same config changes twice
$projectConfig = Craft::$app->getProjectConfig();
$schemaVersion = $projectConfig->get('system.schemaVersion', true);
if (version_compare($schemaVersion, '3.4.0', '>=')) {
return;
}

Is that not the case for you? You just have allowAdminChanges => false without pairing it with useProjectConfigFile => true (and deploying a config/project.yaml file)?

@brandonkelly
Copy link
Member

EDIT: I commented out the lines from ProjectConfig.php and re-ran the migrations and it worked and the upgrade to v3.4 was successful.

@msiemens Please just revert to Craft 3.3 and a pre-update database backup. There’s a high likelihood that something didn’t get migrated properly for you, and hacking around the errors is just going to cause more issues down the road.

@msiemens
Copy link

@msiemens When allowAdminChanges => false, it’s expected that you are on an environment where updates are deployed along with new config/project.yaml files, which would have prevented that code from running in the first place.

I always upgrade Craft and run the migrations on the dev environment first and then sync the project.yml to the production instance and execute migrations + project config sync there. I have àllowAdminChanges => trueand alsouseProjectConfigFile => true`.

Strangely enough, another project where I ran the upgrade with the same setup worked without issues.

@brandonkelly
Copy link
Member

then sync the project.yml to the production instance and execute migrations + project config sync there

@msiemens How are you doing that?

@msiemens
Copy link

@msiemens How are you doing that?

Using rsync to update the source code (including all of config/ and vendor/) and then running ./craft migrate/all && ./craft project-config/sync on the server.

@brandonkelly
Copy link
Member

Alright I believe we’ve gotten to the bottom of this.

We believe everyone experiencing the missing config column error would have gotten a different error about a missing channel column in the queue table first, and then the config error would have started occurring on subsequent requests.

We’ve just released Craft 3.4.0.1 with a fix for the queue.channel error (d4c34cb), so this should be resolved for everyone updating to 3.4 going forward.

If you have experienced an error updating to 3.4 already, you must restore your database using a database backup from before updating to Craft 3.4, and then reattempt the update, going straight to 3.4.0.1 this time.

@leobauza
Copy link

leobauza commented Feb 5, 2020

@brandonkelly I still experiencing some issues when trying to update from 3.1.34 to 3.4.3.

Exception 'yii\db\Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list'
The SQL being executed was: SELECT `config`
FROM `info`
LIMIT 1'
in /var/www/app/vendor/yiisoft/yii2/db/Schema.php:674
Error Info:
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'config' in 'field list'
)

Some more details:

  • I am able to run the update fine in my dev environment (locally) but when I try to deploy it to staging I get the error above, and I see "an internal server error ocurred" if I open the front-end of admin sections of the site. We are using the project config so one of the differences is that allowAdminChanges is set to false in staging (I know that was mentioned earlier in the ticket, not sure if it's relevant.)
  • I am using the same DB locally and in my staging environment
  • I am first updating to 3.1.34.3 because I get the message "You’ve reached a breakpoint! More updates will become available after you install Craft CMS 3.1.34.3."
  • I tried to run project-config/rebuild in between the upgrade to 3.1.34.3 and 3.4.3 since it was mentioned in the changelog

thanks in advance for your help

@brandonkelly
Copy link
Member

@leobauza As I said in my last comment,

We believe everyone experiencing the missing config column error would have gotten a different error about a missing channel column in the queue table first, and then the config error would have started occurring on subsequent requests.

So you need to figure out what the original error was. If you’re not sure, please restore your database to a pre-update backup, and reattempt the update. Pay attention to the original error you get, and look for it in storage/logs/, and please post the full stack trace leading up to it as a new GitHub issue.

@olets
Copy link

olets commented Apr 21, 2021

I had to bring an old Craft 2 database into a site that has been upgraded to Craft 3, and hit a "column not found" error. This issue was the only relevant one in the first page of my search engine results so sharing what worked in case it helps others:

# import db and then
./craft migrate/all
./craft update
./craft migrate/all # was prompted to do this when I tried running `./craft project-config/apply`. ymmv
./craft project-config/apply

and then ./craft plugin/install or enable via the CP any plugins new since the backup was made.

@brandonkelly
Copy link
Member

@olets If you send the Craft 2 database backup over to support@craftcms.com, we can take a look.

@olets
Copy link

olets commented Apr 22, 2021

@brandonkelly I'm all set but thank you! Unless you're especially interested in looking at it

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

7 participants