Column not found: 1054 Unknown column 'context_id' in 'where clause' in /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78

Hi, thanks for your attention. I am updating an ojs magazine from version 2.4.8-4 to 3.3.0-6 but when I run the upgrade.php script I get the above error message.
I installed the new version from .tar.gz and set permissions on all 777 files and folders.

LOG ERROR:
[03-May-2021 19:01:00 Europe/Berlin] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ in /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(78): PDO->prepare(‘SELECT setting_…’, Array)
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(361): Doctrine/DBAL/Driver/PDOConnection->prepare(Object(Illuminate/Database/Query/Expression))
#2 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate/Database/Connection->Illuminate/Database/{closure}(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#4 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#6 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#7 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#8 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#9 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#10 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#11 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#12 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#13 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#14 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#15 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#16 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#17 {main}

Next Doctrine/DBAL/Driver/PDO/Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ in /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(83): Doctrine/DBAL/Driver/PDO/Exception::new(Object(PDOException))
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(361): Doctrine/DBAL/Driver/PDOConnection->prepare(Object(Illuminate/Database/Query/Expression))
#2 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate/Database/Connection->Illuminate/Database/{closure}(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#4 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#6 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#7 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#8 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#9 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#10 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#11 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#12 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#13 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#14 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#15 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#16 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#17 {main}

Next Illuminate/Database/QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ (SQL: SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = announcementfeedplugin AND context_id = 0) in /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#2 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#4 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#6 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#7 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#8 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#9 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#10 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#11 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#12 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#13 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->_construct(Array)
#14 {main}
thrown in /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671
[03-May-2021 19:01:09 Europe/Berlin] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ in /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(78): PDO->prepare('SELECT setting
…’, Array)
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(361): Doctrine/DBAL/Driver/PDOConnection->prepare(Object(Illuminate/Database/Query/Expression))
#2 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate/Database/Connection->Illuminate/Database/{closure}(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#4 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#6 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#7 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#8 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#9 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#10 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#11 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#12 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#13 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#14 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#15 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#16 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#17 {main}

Next Doctrine/DBAL/Driver/PDO/Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ in /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(83): Doctrine/DBAL/Driver/PDO/Exception::new(Object(PDOException))
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(361): Doctrine/DBAL/Driver/PDOConnection->prepare(Object(Illuminate/Database/Query/Expression))
#2 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate/Database/Connection->Illuminate/Database/{closure}(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#4 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#6 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#7 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#8 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#9 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#10 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#11 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#12 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#13 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#14 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#15 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#16 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#17 {main}

Next Illuminate/Database/QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘context_id’ in ‘where clause’ (SQL: SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = announcementfeedplugin AND context_id = 0) in /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
Stack trace:
#0 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate/Database/Connection->runQueryCallback(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#1 /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(373): Illuminate/Database/Connection->run(Object(Illuminate/Database/Query/Expression), Array, Object(Closure))
#2 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(110): Illuminate/Database/Connection->cursor(Object(Illuminate/Database/Query/Expression), Array)
#3 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee…’)
#4 /var/www/jreading/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’)
#5 /var/www/jreading/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get(‘enabled’)
#6 /var/www/jreading/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting(0, ‘announcementfee…’, ‘enabled’)
#7 /var/www/jreading/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting(0, ‘enabled’)
#8 /var/www/jreading/plugins/generic/announcementFeed/AnnouncementFeedPlugin.inc.php(24): LazyLoadPlugin->getEnabled(0)
#9 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): AnnouncementFeedPlugin->register(‘generic’, ‘plugins/generic…’, NULL)
#10 /var/www/jreading/lib/pkp/classes/plugins/PluginRegistry.inc.php(142): PluginRegistry::register(‘generic’, Object(AnnouncementFeedPlugin), ‘plugins/generic…’, NULL)
#11 /var/www/jreading/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategory(‘generic’)
#12 /var/www/jreading/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct(Array)
#13 /var/www/jreading/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#14 {main}
thrown in /var/www/jreading/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

Hi @Dario_Limardo

It’s not possible to upgrade directly from OJS 2.4 to OJS 3.3. You’ll need to go to an intermediate version first. I suggest 3.1.2-4 (there’s a bug in 3.2 that can prevent the migration of supplemental files when upgrading from 2.4 directly).

Cheers,
Jason

Hi @jnugent
i upgraded to version 3.1.2-4 and it worked. Thanks