Error: Class '\Connection' not found

Created on 14 February 2023, almost 2 years ago

Hi,

Suddenly when accessing to my site (any page) I receive the following error:

The website encountered an unexpected error. Please try again later.
Error: Class '\Connection' not found in Drupal\Core\Database\Database::openConnection() (line 371 of /my_site/web/core/lib/Drupal/Core/Database/Database.php).

Drupal\Core\Database\Database::openConnection('default', 'default') (Line: 166)
Drupal\Core\Database\Database::getConnection('default')
call_user_func_array('Drupal\Core\Database\Database::getConnection', Array) (Line: 79)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'database') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('database', 1) (Line: 260)
Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters(Array) (Line: 62)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache.container') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('cache.container') (Line: 543)
Drupal\Core\DrupalKernel->getCachedContainerDefinition() (Line: 904)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 476)
Drupal\Core\DrupalKernel->boot() (Line: 692)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I already checked for similar errors, and I found the following:
https://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&ua...

that was solved by setting the namespace setting in settings.php at 'Drupal\\Core\\Database\\Driver\\mysql'

But in my case the namespace is already set correctly, and I do not know how to proceed

💬 Support request
Status

Closed: duplicate

Version

8.7 ⚰️

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy scimmiettarossa

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

Comments & Activities

Production build 0.71.5 2024