PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1040] Too many connections in OJS 3.2.0-3

Hi,
I see a lot of repeating fatal errors on the php error logs like;

[01-Jun-2020 04:21:00 Europe/Istanbul] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [1040] Too many connections in /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php:70
Stack trace:
#0 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(70): PDO->__construct('mysql:host=loca...', 'databasename', '......', Array)
#1 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'databasename', '......', Array)
#2 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#3 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/ConnectionFactory.php(182): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->I in /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connection.php on line 664

[01-Jun-2020 04:16:19 Europe/Istanbul] PHP Fatal error:  Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=23 in /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php:70
Stack trace:
#0 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(70): PDO->__construct('mysql:host=loca...', '...', '......', Array)
#1 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(100): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', '...', '......', Array)
#2 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php(50): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection(Object(PDOException), 'mysql:host=loca...', '...', '......', Array)
#3 /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysq in /home/journals/public_html/lib/pkp/lib/vendor/illuminate/database/Connectors/Connector.php on line 70

What could be the origin of these errors, do you have any solution for this?
Best regards,
Ugur

Hi @drugurkocak,

You may need to extend your MySQL max_connections configuration parameter.

These are PDO/MySQL error messages, so you might be able to find more guidance by searching outside this forum; the problem is likely to occur in other applications using those tools as well.

Regards,
Alec Smecher
Public Knowledge Project Team

I am also facing the same problem.
Please help

Hi

I am udinh OJS OJS 3.3.0-14
My website https://ijoscience.com/ojsscience/ is shoing up below error:

Fatal error : Uncaught PDOException: SQLSTATE[HY000]: General error: 1467 Failed to read auto-increment value from storage engine in /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119 Stack trace: #0 /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(119): PDOStatement->execute(NULL) #1 /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(489): Doctrine\DBAL\Driver\PDOStatement->execute() #2 /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database{closure}(‘INSERT INTO ses…’, Array) #3 /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallb in /home/support4/public_html/ijoscience.com/ojsscience/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

My host replied that:
I tried to clear the session tables from support4_ojsscience/sessions table, but that made the website access for once then noticed the same error. Upon checking, found the issue with auto-increment. Tried to fix the auto-increment even that did not help to erase the error.

Noticed that session ids do not get updated no matter how many new website sessions were created, it remains the same. Instead it should have auto incremented.

How to solve it

My website https://ijoscience.com/ojsscience/ is showing up in error.
I send the error message to my hosting provider.
My host replied:
I tried to clear the session tables from support4_ojsscience/sessions table, but that made the website access for once then noticed the same error. Upon checking, found the issue with auto-increment. Tried to fix the auto-increment even that did not help to erase the error.

Noticed that session ids do not get updated no matter how many new website sessions were created, it remains the same. Instead it should have auto incremented.
But they could not solve it. Please help