PDOException: SQLSTATE[HY000] [2000] in /drupal/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php

Created on 8 August 2019, almost 6 years ago
Updated 2 April 2025, 3 months ago

My drupal site have getting following error multiple times and the site become down . I am pretty stuck here,

[php7:notice] [pid 25618:tid 139647506151168] [client xxx.111] PDOException: SQLSTATE[HY000] [2000] in /drupal/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php on line 79 #0 /drupal/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(149): PDO->__construct()\n#1 /drupal/core/lib/Drupal/Core/Database/Database.php(376): Drupal\\Core\\Database\\Driver\\mysql\\Connection::open(Array)\n#2 /drupal/core/lib/Drupal/Core/Database/Database.php(166): Drupal\\Core\\Database\\Database::openConnection('default', 'default')\n#3 [internal function]: Drupal\\Core\\Database\\Database::getConnection('default')\n#4 /drupal/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(79): call_user_func_array('Drupal\\\\Core\\\\Dat...', Array)\n#5 /drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\\Component\\DependencyInjection\\PhpArrayContainer->createService(Array, 'database')\n#6 /drupal/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(260): Drupal\\Component\\DependencyInjection\\Container->get('database', 1)\n#7 /drupal/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(62): Drupal\\Component\\DependencyInjection\\PhpArrayContainer->resolveServicesAndParameters(Array)\n#8 /drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\\Component\\DependencyInjection\\PhpArrayContainer->createService(Array, 'cache.container')\n#9 /drupal/core/lib/Drupal/Core/DrupalKernel.php(516): Drupal\\Component\\DependencyInjection\\Container->get('cache.container')\n#10 /drupal/core/lib/Drupal/Core/DrupalKernel.php(877): Drupal\\Core\\DrupalKernel->getCachedContainerDefinition()\n#11 /drupal/core/lib/Drupal/Core/DrupalKernel.php(469): Drupal\\Core\\DrupalKernel->initializeContainer()\n#12 /drupal/core/lib/Drupal/Core/DrupalKernel.php(665): Drupal\\Core\\DrupalKernel->boot()\n#13 /drupal/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#14 {main}

And also We getting some error like
php.ERROR: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[40001]: Serialization failure: 1213 Unknown error 1213: INSERT INTO {semaphore} (name, value, expire) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 0dIEdLN3F3E-gizpTgOlg31snzlsIuqwHBT6pQarz80:user [:db_insert_placeholder_1] => 6098968075d4baf4bad84e8.06341162 [:db_insert_placeholder_2] => 1565241193.7106 ) in Drupal\Core\TempStore\PrivateTempStore->set()

And a particular time instance suddenly increased the SQL connections.
Calling beolw query with continuesly
"Waiting for table metadata lock","INSERT INTO semaphore (name, value, expire) VALUES ('5203:session_entry', '13512856815d4fdbbf265ca7.26803167', '1565514717.1571')" and increased the connections and mysql lost the connection.

Is this both are connected. Any idea on this issue?

🐛 Bug report
Status

Active

Version

8.5 ⚰️

Component

database system

Created by

🇮🇳India aby v a

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands Summit

    Hi, I have the same, what is the fix please? Thanks for your advice in advance! Greetings,

  • 🇳🇱Netherlands Summit

    Hi, should I add then to $databases: 'isolation_level' => 'READ COMMITTED', ?

    $databases['default']['default'] = array(
      'database' => 'databasename',
      'username' => 'sqlusername',
      'password' => 'sqlpassword',
      'host' => 'localhost',
      'driver' => 'mysql',
      'prefix' => '',
      'port' => '3306',
      'isolation_level' => 'READ COMMITTED',
    );
  • Possibly. I was asking what the isolation level is on the affected site. Drupal shows this configuration on the site status report.

  • Status changed to Postponed: needs info 11 days ago
  • 🇳🇿New Zealand quietone

    Drupal 8.5 is EOL and no further support is provided. Does this problem happen on a currently supported version of Drupal?

    If we don't receive confirmation that this happens on a supported version of Drupal, this will be closed after three months.

Production build 0.71.5 2024