Error 500 Internal Server Error

GET http://9fd1beba-e1b7-415e-b396-602507db15ef.centreboard.digital/apply_page

Forwarded to ErrorController (9cdb8b)

Exceptions

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

Doctrine\DBAL\Exception\ ConnectionException

Show exception properties
0 of 0
Doctrine\DBAL\Exception\ConnectionException {#880 â–¼ -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. case 4031:
  9. return new ConnectionLost($exception, $query);
  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 1924)
  1. }
  2. /** @internal */
  3. final public function convertException(Driver\Exception $e): DriverException
  4. {
  5. return $this->handleDriverException($e, null);
  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 385)
  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 1087)
  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. ): array {
  2. $this->switchPersisterContext($offset, $limit);
  3. $sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
  4. [$params, $types] = $this->expandParameters($criteria);
  5. $stmt = $this->conn->executeQuery($sql, $params, $types);
  6. $hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
  7. return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
  8. }
  1. */
  2. public function findBy(array $criteria, array|null $orderBy = null, int|null $limit = null, int|null $offset = null): array
  3. {
  4. $persister = $this->em->getUnitOfWork()->getEntityPersister($this->entityName);
  5. return $persister->loadAll($criteria, $orderBy, $limit, $offset);
  6. }
  7. /**
  8. * Finds a single entity by a set of criteria.
  9. *
  1. * @psalm-suppress InvalidReturnType This proxy is used only in combination with newer parent class
  2. */
  3. public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
  4. {
  5. return ($this->repository ??= $this->resolveRepository())
  6. ->findBy($criteria, $orderBy, $limit, $offset);
  7. }
  8. /** {@inheritDoc} */
  9. public function findOneBy(array $criteria, ?array $orderBy = null): object|null
  10. {
ServiceEntityRepositoryProxy->findBy() in src/Controller/ApplyController.php (line 49)
  1. }
  2. #[Route('/apply_page', name: 'app_apply_page')]
  3. public function index(EditionRepository $editionRepository): Response
  4. {
  5. $editions = $editionRepository->findBy([], ['year' => 'DESC']);
  6. return $this->render('apply/index.html.twig', [
  7. 'controller_name' => 'ApplyController',
  8. 'editions' => $editions,
  9. ]);
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  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. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/fabla/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[HY000] [2002] Connection refused

  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. array $params
  2. ) {
  3. $this->logger->info('Connecting with parameters {params}', ['params' => $this->maskPassword($params)]);
  4. return new Connection(
  5. parent::connect($params),
  6. $this->logger,
  7. );
  8. }
  9. /**
  1. */
  2. public function connect(
  3. #[SensitiveParameter]
  4. array $params
  5. ) {
  6. return $this->wrappedDriver->connect($params);
  7. }
  8. /**
  9. * {@inheritDoc}
  10. */
  1. parent::__construct($driver);
  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. */
  2. public function connect(
  3. #[SensitiveParameter]
  4. array $params
  5. ) {
  6. return $this->wrappedDriver->connect($params);
  7. }
  8. /**
  9. * {@inheritDoc}
  10. */
  1. }
  2. public function connect(array $params): ConnectionInterface
  3. {
  4. $timestamp = time();
  5. $connection = parent::connect($params);
  6. $this->connectionExpiries[$this->connectionName] = $timestamp + $this->ttl;
  7. return $connection;
  8. }
  9. }
  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 1087)
  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. ): array {
  2. $this->switchPersisterContext($offset, $limit);
  3. $sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
  4. [$params, $types] = $this->expandParameters($criteria);
  5. $stmt = $this->conn->executeQuery($sql, $params, $types);
  6. $hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
  7. return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
  8. }
  1. */
  2. public function findBy(array $criteria, array|null $orderBy = null, int|null $limit = null, int|null $offset = null): array
  3. {
  4. $persister = $this->em->getUnitOfWork()->getEntityPersister($this->entityName);
  5. return $persister->loadAll($criteria, $orderBy, $limit, $offset);
  6. }
  7. /**
  8. * Finds a single entity by a set of criteria.
  9. *
  1. * @psalm-suppress InvalidReturnType This proxy is used only in combination with newer parent class
  2. */
  3. public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
  4. {
  5. return ($this->repository ??= $this->resolveRepository())
  6. ->findBy($criteria, $orderBy, $limit, $offset);
  7. }
  8. /** {@inheritDoc} */
  9. public function findOneBy(array $criteria, ?array $orderBy = null): object|null
  10. {
ServiceEntityRepositoryProxy->findBy() in src/Controller/ApplyController.php (line 49)
  1. }
  2. #[Route('/apply_page', name: 'app_apply_page')]
  3. public function index(EditionRepository $editionRepository): Response
  4. {
  5. $editions = $editionRepository->findBy([], ['year' => 'DESC']);
  6. return $this->render('apply/index.html.twig', [
  7. 'controller_name' => 'ApplyController',
  8. 'editions' => $editions,
  9. ]);
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  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. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/fabla/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[HY000] [2002] Connection refused

  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. );
  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. );
  1. */
  2. public function connect(
  3. #[SensitiveParameter]
  4. array $params
  5. ) {
  6. return $this->wrappedDriver->connect($params);
  7. }
  8. /**
  9. * {@inheritDoc}
  10. */
  1. array $params
  2. ) {
  3. $this->logger->info('Connecting with parameters {params}', ['params' => $this->maskPassword($params)]);
  4. return new Connection(
  5. parent::connect($params),
  6. $this->logger,
  7. );
  8. }
  9. /**
  1. */
  2. public function connect(
  3. #[SensitiveParameter]
  4. array $params
  5. ) {
  6. return $this->wrappedDriver->connect($params);
  7. }
  8. /**
  9. * {@inheritDoc}
  10. */
  1. parent::__construct($driver);
  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. */
  2. public function connect(
  3. #[SensitiveParameter]
  4. array $params
  5. ) {
  6. return $this->wrappedDriver->connect($params);
  7. }
  8. /**
  9. * {@inheritDoc}
  10. */
  1. }
  2. public function connect(array $params): ConnectionInterface
  3. {
  4. $timestamp = time();
  5. $connection = parent::connect($params);
  6. $this->connectionExpiries[$this->connectionName] = $timestamp + $this->ttl;
  7. return $connection;
  8. }
  9. }
  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 1087)
  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. ): array {
  2. $this->switchPersisterContext($offset, $limit);
  3. $sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
  4. [$params, $types] = $this->expandParameters($criteria);
  5. $stmt = $this->conn->executeQuery($sql, $params, $types);
  6. $hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
  7. return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
  8. }
  1. */
  2. public function findBy(array $criteria, array|null $orderBy = null, int|null $limit = null, int|null $offset = null): array
  3. {
  4. $persister = $this->em->getUnitOfWork()->getEntityPersister($this->entityName);
  5. return $persister->loadAll($criteria, $orderBy, $limit, $offset);
  6. }
  7. /**
  8. * Finds a single entity by a set of criteria.
  9. *
  1. * @psalm-suppress InvalidReturnType This proxy is used only in combination with newer parent class
  2. */
  3. public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
  4. {
  5. return ($this->repository ??= $this->resolveRepository())
  6. ->findBy($criteria, $orderBy, $limit, $offset);
  7. }
  8. /** {@inheritDoc} */
  9. public function findOneBy(array $criteria, ?array $orderBy = null): object|null
  10. {
ServiceEntityRepositoryProxy->findBy() in src/Controller/ApplyController.php (line 49)
  1. }
  2. #[Route('/apply_page', name: 'app_apply_page')]
  3. public function index(EditionRepository $editionRepository): Response
  4. {
  5. $editions = $editionRepository->findBy([], ['year' => 'DESC']);
  6. return $this->render('apply/index.html.twig', [
  7. 'controller_name' => 'ApplyController',
  8. 'editions' => $editions,
  9. ]);
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  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. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/fabla/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. };