[OJS 3.2.1-4 to 3.3.0-3 with Postgres] Upgrade error: PHP Fatal error: Uncaught PDOException: SQLSTATE[22023]

Hi,
I’m trying to update OJS 3.2.1-4 to OJS 3.3.0-3 and the following error is appearing:

# php tools/upgrade.php upgrade
PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory in /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:38
Stack trace:
#0 /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(38): PDO->__construct('mysql:host=loca...', 'ojs', 'ojs', Array)
#1 /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'ojs', 'ojs', Array)
#2 /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'ojs', 'ojs', Array)
#3 /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#4 /var/www/ojs-3.3.0-3/lib/pk in /var/www/ojs-3.3.0-3/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

It looks weird because we use postgres.
We updated php 7.2 to 7.3 recently. Is there a module missing?

Hi @Adriano_Jose, such an error may indicate the problem with a connection to the MySQL server, e.g., it’s turned off and not running.

It appears many users are experiencing this issue. Check out the thread Problem with upgrading to OJS 3.3.0.3

Hi @crglass, the error message in the referenced topic looks different, which usually implies distinct cause.

Hi, I keep receiving these errors too.
PHP 7.2; OJS 3.2.1-4

[13-Mar-2021 19:56:37 UTC] PHP Fatal error:  Uncaught PDOException: could not find driver in /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php:70

Stack trace:
#0 /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(70): PDO->__construct(‘mysql:host=loca…’, ‘denqgtqu_ojs’, ‘ut^6Y0,4.g}U’, Array)
#1 /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection(‘mysql:host=loca…’, ‘denqgtqu_ojs’, ‘ut^6Y0,4.g}U’, Array)
#2 /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection(‘mysql:host=loca…’, Array, Array)
#3 /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connectors/ConnectionFactory.php(182): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illumin in /home/denqgtqu/public_html/ojs/lib/pkp/lib/vendor/illuminate/database/Connection.php on line 664

I tried using PHP 7.3 ( as mentioned here) but raised another error :frowning:

[13-Mar-2021 20:02:26 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function PKP\Services\json_decode() in /home/denqgtqu/public_html/ojs/lib/pkp/classes/services/PKPSchemaService.inc.php:56

Stack trace:
#0 /home/denqgtqu/public_html/ojs/lib/pkp/classes/site/SiteDAO.inc.php(62): PKP\Services\PKPSchemaService->get(‘site’)
#1 /home/denqgtqu/public_html/ojs/lib/pkp/classes/site/SiteDAO.inc.php(42): SiteDAO->_fromRow(Array)
#2 /home/denqgtqu/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php(490): SiteDAO->getSite()
#3 /home/denqgtqu/public_html/ojs/classes/i18n/AppLocale.inc.php(78): PKPRequest->getSite()
#4 /home/denqgtqu/public_html/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php(140): AppLocale::getLocale()
#5 /home/denqgtqu/public_html/ojs/lib/pkp/classes/core/Dispatcher.inc.php(131): PKPLocale::initialize(Object(Request))
#6 /home/denqgtqu/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php(281): Dispatcher->dispatch(Object(Request))
#7 /home/denqgtqu/public_html/ojs/index.php(68): PKPApplication->execute()
#8 {main}
thrown in /home/denqgtqu/public_html/ojs/lib/pkp/classes/services/PKPSchemaService.inc.php on line 56

Hi @sina,

See: Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1835 Malformed communication packet - #5 by Vitaliy

Please don’t post the same content in several places; it clutters the forum.

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher , I updated this post because there was an error config.inc.php. Now, with the file set up correctly,
this is the error that is appearing:

PHP Fatal error:  Uncaught PDOException: SQLSTATE[22023]: Invalid parameter value: 7 ERROR:  invalid value for parameter "client_encoding": "" in /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php(68): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php(36): Illuminate\Database\Connectors\PostgresConnector->configureEncoding(Object(Doctrine\DBAL\Driver\PDOConnection), Array)
#3 /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\PostgresConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connect in /var/www/ojs-3.3.0-4/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

I didn’t find any other equivalent post with this error.
I upgraded the php from 7.1 to 7.3 recently. Is there a module missing? The json was already installed.

Hi @Adriano_Jose,

What is the connection_charset option in config.inc.php set to?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
It is:
connection_charset = utf8

Is it ok?

Regards,
Adriano Moreno

Hi @Adriano_Jose,

Is that (#4) the end of the stack trace, or is there more?

Regards,
Alec Smecher
Public Knowledge Project Team