http://pms.cmet.ustc.edu.cn/notice-attachment/download/131

Exceptions

An exception occurred in the driver: SQLSTATE[08004] [1040] Too many connections

Exceptions 3

Doctrine\DBAL\Exception\ DriverException

  1.             case 1364:
  2.             case 1566:
  3.                 return new NotNullConstraintViolationException($exception$query);
  4.         }
  5.         return new DriverException($exception$query);
  6.     }
  7. }
  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 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
in vendor/doctrine/dbal/src/Connection.php -> convertException (line 380)
  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.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.     {
  2.         $this->switchPersisterContext(null$limit);
  3.         $sql              $this->getSelectSQL($criteria$assoc$lockMode$limitnull$orderBy);
  4.         [$params$types] = $this->expandParameters($criteria);
  5.         $stmt             $this->conn->executeQuery($sql$params$types);
  6.         if ($entity !== null) {
  7.             $hints[Query::HINT_REFRESH]        = true;
  8.             $hints[Query::HINT_REFRESH_ENTITY] = $entity;
  9.         }
  1.     /**
  2.      * {@inheritDoc}
  3.      */
  4.     public function loadById(array $identifier$entity null)
  5.     {
  6.         return $this->load($identifier$entity);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.             case $lockMode === LockMode::PESSIMISTIC_READ:
  2.             case $lockMode === LockMode::PESSIMISTIC_WRITE:
  3.                 return $persister->load($sortedIdnullnull, [], $lockMode);
  4.             default:
  5.                 return $persister->loadById($sortedId);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  1.     public function find($className$id$lockMode null$lockVersion null)
  2.     {
  3.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'find', array('className' => $className'id' => $id'lockMode' => $lockMode'lockVersion' => $lockVersion), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  4.         return $this->valueHolderf992b->find($className$id$lockMode$lockVersion);
  5.     }
  6.     public function getReference($entityName$id)
  7.     {
  8.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'getReference', array('entityName' => $entityName'id' => $id), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  1.      * @return object|null The entity instance or NULL if the entity can not be found.
  2.      * @psalm-return ?T
  3.      */
  4.     public function find($id$lockMode null$lockVersion null)
  5.     {
  6.         return $this->_em->find($this->_entityName$id$lockMode$lockVersion);
  7.     }
  8.     /**
  9.      * Finds all entities in the repository.
  10.      *
  1.                 $cacheProvider->evictEntity($class$id);
  2.             }
  3.         }
  4.         try {
  5.             return $om->getRepository($class)->$method($id);
  6.         } catch (NoResultException $e) {
  7.             return;
  8.         } catch (ConversionException $e) {
  9.             return;
  10.         }
  1.             if (null === $object) {
  2.                 $errorMessage sprintf('The expression "%s" returned null'$expr);
  3.             }
  4.             // find by identifier?
  5.         } elseif (false === $object $this->find($class$request$options$name)) {
  6.             // find by criteria
  7.             if (false === $object $this->findOneBy($class$request$options)) {
  8.                 if ($configuration->isOptional()) {
  9.                     $object null;
  10.                 } else {
  1.             return;
  2.         }
  3.         foreach ($this->all() as $converter) {
  4.             if ($converter->supports($configuration)) {
  5.                 if ($converter->apply($request$configuration)) {
  6.                     return;
  7.                 }
  8.             }
  9.         }
  10.     }
  1.         if (\is_object($configurations)) {
  2.             $configurations = [$configurations];
  3.         }
  4.         foreach ($configurations as $configuration) {
  5.             $this->applyConverter($request$configuration);
  6.         }
  7.     }
  8.     /**
  9.      * Applies converter on request based on the given configuration.
  1.             }
  2.             $configurations $this->autoConfigure($r$request$configurations);
  3.         }
  4.         $this->manager->apply($request$configurations);
  5.     }
  6.     private function autoConfigure(\ReflectionFunctionAbstract $rRequest $request$configurations)
  7.     {
  8.         foreach ($r->getParameters() as $param) {
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.         if (false === $controller $this->resolver->getController($request)) {
  2.             throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.'$request->getPathInfo()));
  3.         }
  4.         $event = new ControllerEvent($this$controller$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER);
  6.         $controller $event->getController();
  7.         // controller arguments
  8.         $arguments $this->argumentResolver->getArguments($request$controller);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Doctrine\DBAL\Driver\PDO\ Exception

SQLSTATE[08004] [1040] Too many connections

  1.         } else {
  2.             $code     $exception->getCode();
  3.             $sqlState null;
  4.         }
  5.         return new self($exception->getMessage(), $sqlState$code$exception);
  6.     }
  7. }
  1.                 $params['user'] ?? '',
  2.                 $params['password'] ?? '',
  3.                 $driverOptions,
  4.             );
  5.         } catch (PDOException $exception) {
  6.             throw Exception::new($exception);
  7.         }
  8.         return new Connection($pdo);
  9.     }
  1.      */
  2.     public function connect(
  3.         #[SensitiveParameter]
  4.         array $params
  5.     ) {
  6.         return $this->wrappedDriver->connect($params);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.         $this->connectionName $connectionName;
  2.     }
  3.     public function connect(array $params): ConnectionInterface
  4.     {
  5.         $connection parent::connect($params);
  6.         if ('void' !== (string) (new \ReflectionMethod(DriverInterface\Connection::class, 'commit'))->getReturnType()) {
  7.             return new DBAL3\Connection(
  8.                 $connection,
  9.                 $this->debugDataHolder,
  1.         if ($this->_conn !== null) {
  2.             return false;
  3.         }
  4.         try {
  5.             $this->_conn $this->_driver->connect($this->params);
  6.         } catch (Driver\Exception $e) {
  7.             throw $this->convertException($e);
  8.         }
  9.         if ($this->autoCommit === false) {
  1.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.     {
  2.         $this->switchPersisterContext(null$limit);
  3.         $sql              $this->getSelectSQL($criteria$assoc$lockMode$limitnull$orderBy);
  4.         [$params$types] = $this->expandParameters($criteria);
  5.         $stmt             $this->conn->executeQuery($sql$params$types);
  6.         if ($entity !== null) {
  7.             $hints[Query::HINT_REFRESH]        = true;
  8.             $hints[Query::HINT_REFRESH_ENTITY] = $entity;
  9.         }
  1.     /**
  2.      * {@inheritDoc}
  3.      */
  4.     public function loadById(array $identifier$entity null)
  5.     {
  6.         return $this->load($identifier$entity);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.             case $lockMode === LockMode::PESSIMISTIC_READ:
  2.             case $lockMode === LockMode::PESSIMISTIC_WRITE:
  3.                 return $persister->load($sortedIdnullnull, [], $lockMode);
  4.             default:
  5.                 return $persister->loadById($sortedId);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  1.     public function find($className$id$lockMode null$lockVersion null)
  2.     {
  3.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'find', array('className' => $className'id' => $id'lockMode' => $lockMode'lockVersion' => $lockVersion), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  4.         return $this->valueHolderf992b->find($className$id$lockMode$lockVersion);
  5.     }
  6.     public function getReference($entityName$id)
  7.     {
  8.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'getReference', array('entityName' => $entityName'id' => $id), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  1.      * @return object|null The entity instance or NULL if the entity can not be found.
  2.      * @psalm-return ?T
  3.      */
  4.     public function find($id$lockMode null$lockVersion null)
  5.     {
  6.         return $this->_em->find($this->_entityName$id$lockMode$lockVersion);
  7.     }
  8.     /**
  9.      * Finds all entities in the repository.
  10.      *
  1.                 $cacheProvider->evictEntity($class$id);
  2.             }
  3.         }
  4.         try {
  5.             return $om->getRepository($class)->$method($id);
  6.         } catch (NoResultException $e) {
  7.             return;
  8.         } catch (ConversionException $e) {
  9.             return;
  10.         }
  1.             if (null === $object) {
  2.                 $errorMessage sprintf('The expression "%s" returned null'$expr);
  3.             }
  4.             // find by identifier?
  5.         } elseif (false === $object $this->find($class$request$options$name)) {
  6.             // find by criteria
  7.             if (false === $object $this->findOneBy($class$request$options)) {
  8.                 if ($configuration->isOptional()) {
  9.                     $object null;
  10.                 } else {
  1.             return;
  2.         }
  3.         foreach ($this->all() as $converter) {
  4.             if ($converter->supports($configuration)) {
  5.                 if ($converter->apply($request$configuration)) {
  6.                     return;
  7.                 }
  8.             }
  9.         }
  10.     }
  1.         if (\is_object($configurations)) {
  2.             $configurations = [$configurations];
  3.         }
  4.         foreach ($configurations as $configuration) {
  5.             $this->applyConverter($request$configuration);
  6.         }
  7.     }
  8.     /**
  9.      * Applies converter on request based on the given configuration.
  1.             }
  2.             $configurations $this->autoConfigure($r$request$configurations);
  3.         }
  4.         $this->manager->apply($request$configurations);
  5.     }
  6.     private function autoConfigure(\ReflectionFunctionAbstract $rRequest $request$configurations)
  7.     {
  8.         foreach ($r->getParameters() as $param) {
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.         if (false === $controller $this->resolver->getController($request)) {
  2.             throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.'$request->getPathInfo()));
  3.         }
  4.         $event = new ControllerEvent($this$controller$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER);
  6.         $controller $event->getController();
  7.         // controller arguments
  8.         $arguments $this->argumentResolver->getArguments($request$controller);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

PDOException

SQLSTATE[08004] [1040] Too many connections

  1.         $safeParams $params;
  2.         unset($safeParams['password'], $safeParams['url']);
  3.         try {
  4.             $pdo = new PDO(
  5.                 $this->constructPdoDsn($safeParams),
  6.                 $params['user'] ?? '',
  7.                 $params['password'] ?? '',
  8.                 $driverOptions,
  9.             );
  10.         } catch (PDOException $exception) {
  1.         $safeParams $params;
  2.         unset($safeParams['password'], $safeParams['url']);
  3.         try {
  4.             $pdo = new PDO(
  5.                 $this->constructPdoDsn($safeParams),
  6.                 $params['user'] ?? '',
  7.                 $params['password'] ?? '',
  8.                 $driverOptions,
  9.             );
  10.         } catch (PDOException $exception) {
  1.      */
  2.     public function connect(
  3.         #[SensitiveParameter]
  4.         array $params
  5.     ) {
  6.         return $this->wrappedDriver->connect($params);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.         $this->connectionName $connectionName;
  2.     }
  3.     public function connect(array $params): ConnectionInterface
  4.     {
  5.         $connection parent::connect($params);
  6.         if ('void' !== (string) (new \ReflectionMethod(DriverInterface\Connection::class, 'commit'))->getReturnType()) {
  7.             return new DBAL3\Connection(
  8.                 $connection,
  9.                 $this->debugDataHolder,
  1.         if ($this->_conn !== null) {
  2.             return false;
  3.         }
  4.         try {
  5.             $this->_conn $this->_driver->connect($this->params);
  6.         } catch (Driver\Exception $e) {
  7.             throw $this->convertException($e);
  8.         }
  9.         if ($this->autoCommit === false) {
  1.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.     {
  2.         $this->switchPersisterContext(null$limit);
  3.         $sql              $this->getSelectSQL($criteria$assoc$lockMode$limitnull$orderBy);
  4.         [$params$types] = $this->expandParameters($criteria);
  5.         $stmt             $this->conn->executeQuery($sql$params$types);
  6.         if ($entity !== null) {
  7.             $hints[Query::HINT_REFRESH]        = true;
  8.             $hints[Query::HINT_REFRESH_ENTITY] = $entity;
  9.         }
  1.     /**
  2.      * {@inheritDoc}
  3.      */
  4.     public function loadById(array $identifier$entity null)
  5.     {
  6.         return $this->load($identifier$entity);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.             case $lockMode === LockMode::PESSIMISTIC_READ:
  2.             case $lockMode === LockMode::PESSIMISTIC_WRITE:
  3.                 return $persister->load($sortedIdnullnull, [], $lockMode);
  4.             default:
  5.                 return $persister->loadById($sortedId);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  1.     public function find($className$id$lockMode null$lockVersion null)
  2.     {
  3.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'find', array('className' => $className'id' => $id'lockMode' => $lockMode'lockVersion' => $lockVersion), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  4.         return $this->valueHolderf992b->find($className$id$lockMode$lockVersion);
  5.     }
  6.     public function getReference($entityName$id)
  7.     {
  8.         $this->initializer272b7 && ($this->initializer272b7->__invoke($valueHolderf992b$this'getReference', array('entityName' => $entityName'id' => $id), $this->initializer272b7) || 1) && $this->valueHolderf992b $valueHolderf992b;
  1.      * @return object|null The entity instance or NULL if the entity can not be found.
  2.      * @psalm-return ?T
  3.      */
  4.     public function find($id$lockMode null$lockVersion null)
  5.     {
  6.         return $this->_em->find($this->_entityName$id$lockMode$lockVersion);
  7.     }
  8.     /**
  9.      * Finds all entities in the repository.
  10.      *
  1.                 $cacheProvider->evictEntity($class$id);
  2.             }
  3.         }
  4.         try {
  5.             return $om->getRepository($class)->$method($id);
  6.         } catch (NoResultException $e) {
  7.             return;
  8.         } catch (ConversionException $e) {
  9.             return;
  10.         }
  1.             if (null === $object) {
  2.                 $errorMessage sprintf('The expression "%s" returned null'$expr);
  3.             }
  4.             // find by identifier?
  5.         } elseif (false === $object $this->find($class$request$options$name)) {
  6.             // find by criteria
  7.             if (false === $object $this->findOneBy($class$request$options)) {
  8.                 if ($configuration->isOptional()) {
  9.                     $object null;
  10.                 } else {
  1.             return;
  2.         }
  3.         foreach ($this->all() as $converter) {
  4.             if ($converter->supports($configuration)) {
  5.                 if ($converter->apply($request$configuration)) {
  6.                     return;
  7.                 }
  8.             }
  9.         }
  10.     }
  1.         if (\is_object($configurations)) {
  2.             $configurations = [$configurations];
  3.         }
  4.         foreach ($configurations as $configuration) {
  5.             $this->applyConverter($request$configuration);
  6.         }
  7.     }
  8.     /**
  9.      * Applies converter on request based on the given configuration.
  1.             }
  2.             $configurations $this->autoConfigure($r$request$configurations);
  3.         }
  4.         $this->manager->apply($request$configurations);
  5.     }
  6.     private function autoConfigure(\ReflectionFunctionAbstract $rRequest $request$configurations)
  7.     {
  8.         foreach ($r->getParameters() as $param) {
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.         if (false === $controller $this->resolver->getController($request)) {
  2.             throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.'$request->getPathInfo()));
  3.         }
  4.         $event = new ControllerEvent($this$controller$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER);
  6.         $controller $event->getController();
  7.         // controller arguments
  8.         $arguments $this->argumentResolver->getArguments($request$controller);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Stack Traces 3

[3/3] DriverException
Doctrine\DBAL\Exception\DriverException:
An exception occurred in the driver: SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117
  at Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
     (vendor/doctrine/dbal/src/Connection.php:1943)
  at Doctrine\DBAL\Connection->handleDriverException()
     (vendor/doctrine/dbal/src/Connection.php:1891)
  at Doctrine\DBAL\Connection->convertException()
     (vendor/doctrine/dbal/src/Connection.php:380)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:776)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:794)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById()
     (vendor/doctrine/orm/src/EntityManager.php:521)
  at Doctrine\ORM\EntityManager->find()
     (var/cache/dev/ContainerBykbw1h/EntityManager_9a5be93.php:143)
  at ContainerBykbw1h\EntityManager_9a5be93->find()
     (vendor/doctrine/orm/src/EntityRepository.php:197)
  at Doctrine\ORM\EntityRepository->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:142)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:91)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->apply()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:84)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->applyConverter()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:48)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->apply()
     (vendor/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php:72)
  at Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener->onKernelController()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)                
[2/3] Exception
Doctrine\DBAL\Driver\PDO\Exception:
SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28
  at Doctrine\DBAL\Driver\PDO\Exception::new()
     (vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:40)
  at Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()
     (vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29)
  at Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect()
     (vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41)
  at Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect()
     (vendor/doctrine/dbal/src/Connection.php:378)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:776)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:794)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById()
     (vendor/doctrine/orm/src/EntityManager.php:521)
  at Doctrine\ORM\EntityManager->find()
     (var/cache/dev/ContainerBykbw1h/EntityManager_9a5be93.php:143)
  at ContainerBykbw1h\EntityManager_9a5be93->find()
     (vendor/doctrine/orm/src/EntityRepository.php:197)
  at Doctrine\ORM\EntityRepository->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:142)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:91)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->apply()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:84)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->applyConverter()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:48)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->apply()
     (vendor/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php:72)
  at Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener->onKernelController()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)                
[1/3] PDOException
PDOException:
SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34
  at PDO->__construct()
     (vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34)
  at Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()
     (vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29)
  at Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect()
     (vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41)
  at Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect()
     (vendor/doctrine/dbal/src/Connection.php:378)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:776)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load()
     (vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:794)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById()
     (vendor/doctrine/orm/src/EntityManager.php:521)
  at Doctrine\ORM\EntityManager->find()
     (var/cache/dev/ContainerBykbw1h/EntityManager_9a5be93.php:143)
  at ContainerBykbw1h\EntityManager_9a5be93->find()
     (vendor/doctrine/orm/src/EntityRepository.php:197)
  at Doctrine\ORM\EntityRepository->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:142)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->find()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:91)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->apply()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:84)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->applyConverter()
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:48)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->apply()
     (vendor/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php:72)
  at Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener->onKernelController()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)