Cannot update the database from OJS 3.3.0-13 to OJS 3.4.0-4 - suspicious SQL query missing quotes around a string value

App version: OJS 3.4.0-4 (upgrade from OJS 3.3.0-13)
PHP is updated to 8.2.13 and the recommended PHP-extensions have been installed.
The database is running on a local mariadb-server version 10.3.39

Installed PHP-extensions

  • php-cli.x86_64
  • php-common.x86_64
  • php-devel.x86_64
  • php-fedora-autoloader.noarch
  • php-fpm.x86_64
  • php-gd.x86_64
  • php-intl.x86_64
  • php-mbstring.x86_64
  • php-mysqlnd.x86_64
  • php-pdo.x86_64
  • php-pear.noarch
  • php-pecl-mysql.x86_64
  • php-pecl-zip.x86_64
  • php-process.x86_64
  • php-xml.x86_64

Problem
Running php tools/upgrade.php check fails. This could possibly be due to a malformed SQL query.

Suspicious SQL-query

Next Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = webfeedplugin AND context_id = 0) in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760

The interesting thing to look at here might be that the SQL query being run here fails when being run against the database because plugin_name = webfeedplugin in the SQL query should be plugin_name = “webfeedplugin”
plugin_name should be a string value, and therefore there needs to be quotes around “webfeedplugin”
If the upgrade is trying to run this query against the database without quotes, then obviously it would fail.

Could there be an error in some upgrade scripts?

Full Stack trace/Error messages:
php tools/upgrade.php check
PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
Stack trace:
#0 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(70): PDO->__construct()
#1 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(100): Illuminate\Database\Connectors\Connector->createPdoConnection()
#2 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(49): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection()
#3 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#6 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1181): call_user_func()
#7 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1217): Illuminate\Database\Connection->getPdo()
#8 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(486): Illuminate\Database\Connection->getReadPdo()
#9 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(443): Illuminate\Database\Connection->getPdoForSelect()
#10 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#11 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#12 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(878): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#13 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(722): Illuminate\Database\Connection->handleQueryException()
#14 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(435): Illuminate\Database\Connection->run()
#15 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(121): Illuminate\Database\Connection->cursor()
#16 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(93): PKP\plugins\PluginSettingsDAO->getPluginSettings()
#17 [internal function]: PKP\plugins\PluginSettingsDAO->_cacheMiss()
#18 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cache/GenericCache.php(69): call_user_func_array()
#19 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(60): PKP\cache\GenericCache->get()
#20 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/Plugin.php(509): PKP\plugins\PluginSettingsDAO->getSetting()
#21 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/LazyLoadPlugin.php(81): PKP\plugins\Plugin->getSetting()
#22 /vhost-path/ojs-3.4.0-4/vhost/plugins/generic/webFeed/WebFeedPlugin.php(40): PKP\plugins\LazyLoadPlugin->getEnabled()
#23 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\webFeed\WebFeedPlugin->register()
#24 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#25 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins{closure}()
#26 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#27 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/CommandLineTool.php(72): PKP\plugins\PluginRegistry::loadCategory()
#28 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/UpgradeTool.php(39): PKP\cliTool\CommandLineTool->__construct()
#29 /vhost-path/ojs-3.4.0-4/vhost/tools/upgrade.php(21): PKP\cliTool\UpgradeTool->__construct()
#30 {main}

Next Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = webfeedplugin AND context_id = 0) in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
Stack trace:
#0 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#1 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(878): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#2 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(722): Illuminate\Database\Connection->handleQueryException()
#3 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(435): Illuminate\Database\Connection->run()
#4 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(121): Illuminate\Database\Connection->cursor()
#5 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(93): PKP\plugins\PluginSettingsDAO->getPluginSettings()
#6 [internal function]: PKP\plugins\PluginSettingsDAO->_cacheMiss()
#7 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cache/GenericCache.php(69): call_user_func_array()
#8 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(60): PKP\cache\GenericCache->get()
#9 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/Plugin.php(509): PKP\plugins\PluginSettingsDAO->getSetting()
#10 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/LazyLoadPlugin.php(81): PKP\plugins\Plugin->getSetting()
#11 /vhost-path/ojs-3.4.0-4/vhost/plugins/generic/webFeed/WebFeedPlugin.php(40): PKP\plugins\LazyLoadPlugin->getEnabled()
#12 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\webFeed\WebFeedPlugin->register()
#13 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#14 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins{closure}()
#15 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#16 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/CommandLineTool.php(72): PKP\plugins\PluginRegistry::loadCategory()
#17 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/UpgradeTool.php(39): PKP\cliTool\CommandLineTool->__construct()
#18 /vhost-path/ojs-3.4.0-4/vhost/tools/upgrade.php(21): PKP\cliTool\UpgradeTool->__construct()
#19 {main}
thrown in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 760

Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
Stack trace:
#0 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(70): PDO->__construct()
#1 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(100): Illuminate\Database\Connectors\Connector->createPdoConnection()
#2 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(49): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection()
#3 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#6 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1181): call_user_func()
#7 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1217): Illuminate\Database\Connection->getPdo()
#8 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(486): Illuminate\Database\Connection->getReadPdo()
#9 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(443): Illuminate\Database\Connection->getPdoForSelect()
#10 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database{closure}()
#11 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#12 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(878): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#13 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(722): Illuminate\Database\Connection->handleQueryException()
#14 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(435): Illuminate\Database\Connection->run()
#15 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(121): Illuminate\Database\Connection->cursor()
#16 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(93): PKP\plugins\PluginSettingsDAO->getPluginSettings()
#17 [internal function]: PKP\plugins\PluginSettingsDAO->_cacheMiss()
#18 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cache/GenericCache.php(69): call_user_func_array()
#19 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(60): PKP\cache\GenericCache->get()
#20 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/Plugin.php(509): PKP\plugins\PluginSettingsDAO->getSetting()
#21 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/LazyLoadPlugin.php(81): PKP\plugins\Plugin->getSetting()
#22 /vhost-path/ojs-3.4.0-4/vhost/plugins/generic/webFeed/WebFeedPlugin.php(40): PKP\plugins\LazyLoadPlugin->getEnabled()
#23 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\webFeed\WebFeedPlugin->register()
#24 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#25 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins{closure}()
#26 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#27 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/CommandLineTool.php(72): PKP\plugins\PluginRegistry::loadCategory()
#28 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/UpgradeTool.php(39): PKP\cliTool\CommandLineTool->__construct()
#29 /vhost-path/ojs-3.4.0-4/vhost/tools/upgrade.php(21): PKP\cliTool\UpgradeTool->__construct()
#30 {main}

Next Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = webfeedplugin AND context_id = 0) in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
Stack trace:
#0 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(899): Illuminate\Database\Connection->runQueryCallback()
#1 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(878): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
#2 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(722): Illuminate\Database\Connection->handleQueryException()
#3 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(435): Illuminate\Database\Connection->run()
#4 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(121): Illuminate\Database\Connection->cursor()
#5 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(93): PKP\plugins\PluginSettingsDAO->getPluginSettings()
#6 [internal function]: PKP\plugins\PluginSettingsDAO->_cacheMiss()
#7 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cache/GenericCache.php(69): call_user_func_array()
#8 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginSettingsDAO.php(60): PKP\cache\GenericCache->get()
#9 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/Plugin.php(509): PKP\plugins\PluginSettingsDAO->getSetting()
#10 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/LazyLoadPlugin.php(81): PKP\plugins\Plugin->getSetting()
#11 /vhost-path/ojs-3.4.0-4/vhost/plugins/generic/webFeed/WebFeedPlugin.php(40): PKP\plugins\LazyLoadPlugin->getEnabled()
#12 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\webFeed\WebFeedPlugin->register()
#13 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#14 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins{closure}()
#15 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#16 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/CommandLineTool.php(72): PKP\plugins\PluginRegistry::loadCategory()
#17 /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/classes/cliTool/UpgradeTool.php(39): PKP\cliTool\CommandLineTool->__construct()
#18 /vhost-path/ojs-3.4.0-4/vhost/tools/upgrade.php(21): PKP\cliTool\UpgradeTool->__construct()
#19 {main}
thrown in /vhost-path/ojs-3.4.0-4/vhost/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 760
[root@journals-stage vhost]#

Hello, I have experienced same situation here.
I have figured out that this error related to MySQL connection setting on OJS.
In my case, i just need to write the exact port and unix_socket at config.inc.php :

[database]

driver = mysqli
host = localhost
username = xxxxx
password = xxxxx
name = xxxxx

port = 3306
unix_socket = /Applications/MAMP/tmp/mysql/mysql.sock 

I use MAMP on my mac, so if you use different OS or stack, you have to find the exact location of your mysql unix_socket path

Now i can use check command with no error appear.

$ php tools/upgrade.php check                                                                  
Code version:      3.4.0.6
Database version:  3.4.0.5
Latest version:    3.4.0.6
Database version is older than code version
Run "tools/upgrade.php upgrade" to update

Note: The errors that appear during upgrade process are different story :grin: