Symfony Exception

PDOException Exception ConnectionException

HTTP 500 Internal Server Error

An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused

Exceptions 3

Doctrine\DBAL\Exception\ ConnectionException

Show exception properties
Doctrine\DBAL\Exception\ConnectionException {#554
  -query: null
}
  1.             case 1370:
  2.             case 1429:
  3.             case 2002:
  4.             case 2005:
  5.             case 2054:
  6.                 return new ConnectionException($exception$query);
  7.             case 2006:
  8.                 return new ConnectionLost($exception$query);
  9.             case 1048:
  1.     private function handleDriverException(
  2.         Driver\Exception $driverException,
  3.         ?Query $query
  4.     ): DriverException {
  5.         $this->exceptionConverter ??= $this->_driver->getExceptionConverter();
  6.         $exception                  $this->exceptionConverter->convert($driverException$query);
  7.         if ($exception instanceof ConnectionLost) {
  8.             $this->close();
  9.         }
in /var/www/shopware/vendor/doctrine/dbal/src/Connection.php -> handleDriverException (line 1891)
  1.     }
  2.     /** @internal */
  3.     final public function convertException(Driver\Exception $e): DriverException
  4.     {
  5.         return $this->handleDriverException($enull);
  6.     }
  7.     /**
  8.      * @param array<int, mixed>|array<string, mixed>                               $params
  9.      * @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types
  1.         }
  2.         try {
  3.             $this->_conn $this->_driver->connect($this->params);
  4.         } catch (Driver\Exception $e) {
  5.             throw $this->convertException($e);
  6.         }
  7.         if ($this->autoCommit === false) {
  8.             $this->beginTransaction();
  9.         }
  1.         }
  2.         // If not connected, we need to connect now to determine the platform version.
  3.         if ($this->_conn === null) {
  4.             try {
  5.                 $this->connect();
  6.             } catch (Exception $originalException) {
  7.                 if (! isset($this->params['dbname'])) {
  8.                     throw $originalException;
  9.                 }
in /var/www/shopware/vendor/doctrine/dbal/src/Connection.php -> getDatabasePlatformVersion (line 411)
  1.      *
  2.      * @throws Exception If an invalid platform was specified for this connection.
  3.      */
  4.     private function detectDatabasePlatform(): AbstractPlatform
  5.     {
  6.         $version $this->getDatabasePlatformVersion();
  7.         if ($version !== null) {
  8.             assert($this->_driver instanceof VersionAwarePlatformDriver);
  9.             return $this->_driver->createDatabasePlatformForVersion($version);
in /var/www/shopware/vendor/doctrine/dbal/src/Connection.php -> detectDatabasePlatform (line 318)
  1.      * @throws Exception
  2.      */
  3.     public function getDatabasePlatform()
  4.     {
  5.         if ($this->platform === null) {
  6.             $this->platform $this->detectDatabasePlatform();
  7.             $this->platform->setEventManager($this->_eventManager);
  8.             $this->platform->setDisableTypeComments($this->_config->getDisableTypeComments());
  9.         }
  10.         return $this->platform;
  1.     }
  2.     /** @throws Exception */
  3.     private function getSQLForSelect(): string
  4.     {
  5.         return $this->connection->getDatabasePlatform()
  6.             ->createSelectSQLBuilder()
  7.             ->buildSQL(
  8.                 new SelectQuery(
  9.                     $this->sqlParts['distinct'],
  10.                     $this->sqlParts['select'],
  1.             case self::UPDATE:
  2.                 $sql $this->getSQLForUpdate();
  3.                 break;
  4.             case self::SELECT:
  5.                 $sql $this->getSQLForSelect();
  6.                 break;
  7.         }
  8.         $this->state self::STATE_CLEAN;
  9.         $this->sql   $sql;
  1.     /**
  2.      * @return string
  3.      */
  4.     public function getSQL()
  5.     {
  6.         $sql parent::getSQL();
  7.         if ($this->getTitle()) {
  8.             $sql '# ' $this->title \PHP_EOL $sql;
  9.         }
  1.      * @throws Exception
  2.      */
  3.     public function executeQuery(): Result
  4.     {
  5.         return $this->connection->executeQuery(
  6.             $this->getSQL(),
  7.             $this->params,
  8.             $this->paramTypes,
  9.             $this->resultCacheProfile,
  10.         );
  11.     }