Symfony Exception

PDOException QueryException

HTTP 500 Internal Server Error

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `seo_urls_redirect` where `url_source` = /nang-cao-hieu-qua-giam-sat and `active` = 1 limit 1)

Exceptions 2

Illuminate\Database\ QueryException

  1.         // If an exception occurs when attempting to run a query, we'll format the error
  2.         // message to include the bindings with SQL, which will make this exception a
  3.         // lot more helpful to the developer instead of just the database's errors.
  4.         catch (Exception $e) {
  5.             throw new QueryException(
  6.                 $query$this->prepareBindings($bindings), $e
  7.             );
  8.         }
  9.         return $result;
  1.     protected function tryAgainIfCausedByLostConnection(QueryException $e$query$bindingsClosure $callback)
  2.     {
  3.         if ($this->causedByLostConnection($e->getPrevious())) {
  4.             $this->reconnect();
  5.             return $this->runQueryCallback($query$bindings$callback);
  6.         }
  7.         throw $e;
  8.     }
  1.         if ($this->transactions >= 1) {
  2.             throw $e;
  3.         }
  4.         return $this->tryAgainIfCausedByLostConnection(
  5.             $e$query$bindings$callback
  6.         );
  7.     }
  8.     /**
  9.      * Handle a query exception that occurred during query execution.
  1.         // to re-establish connection and re-run the query with a fresh connection.
  2.         try {
  3.             $result $this->runQueryCallback($query$bindings$callback);
  4.         } catch (QueryException $e) {
  5.             $result $this->handleQueryException(
  6.                 $e$query$bindings$callback
  7.             );
  8.         }
  9.         // Once we have run the query we will calculate the time that it took to run and
  10.         // then log the query, bindings, and execution time so we will report them on
  1.             $this->bindValues($statement$this->prepareBindings($bindings));
  2.             $statement->execute();
  3.             return $statement->fetchAll();
  4.         });
  5.     }
  6.     /**
  7.      * Run a select statement against the database and returns a generator.
  8.      *
  1.      * @return array
  2.      */
  3.     protected function runSelect()
  4.     {
  5.         return $this->connection->select(
  6.             $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  7.         );
  8.     }
  9.     /**
  10.      * Paginate the given query into a simple paginator.
  1.      * @return \Illuminate\Support\Collection
  2.      */
  3.     public function get($columns = ['*'])
  4.     {
  5.         return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  6.             return $this->processor->processSelect($this$this->runSelect());
  7.         }));
  8.     }
  9.     /**
  10.      * Run the query as a "select" statement against the connection.
  1.         if (is_null($original)) {
  2.             $this->columns $columns;
  3.         }
  4.         $result $callback();
  5.         $this->columns $original;
  6.         return $result;
  7.     }
  1.      */
  2.     public function get($columns = ['*'])
  3.     {
  4.         return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  5.             return $this->processor->processSelect($this$this->runSelect());
  6.         }));
  7.     }
  8.     /**
  9.      * Run the query as a "select" statement against the connection.
  10.      *
  1.      * @return \Illuminate\Database\Eloquent\Model[]|static[]
  2.      */
  3.     public function getModels($columns = ['*'])
  4.     {
  5.         return $this->model->hydrate(
  6.             $this->query->get($columns)->all()
  7.         )->all();
  8.     }
  9.     /**
  10.      * Eager load the relationships for the models.
  1.         $builder $this->applyScopes();
  2.         // If we actually found models we will also eager load any relationships that
  3.         // have been specified as needing to be eager loaded, which will solve the
  4.         // n+1 query issue for the developers to avoid running a lot of queries.
  5.         if (count($models $builder->getModels($columns)) > 0) {
  6.             $models $builder->eagerLoadRelations($models);
  7.         }
  8.         return $builder->getModel()->newCollection($models);
  9.     }
  1.      * @param  array|string  $columns
  2.      * @return \Illuminate\Database\Eloquent\Model|object|static|null
  3.      */
  4.     public function first($columns = ['*'])
  5.     {
  6.         return $this->take(1)->get($columns)->first();
  7.     }
  8.     /**
  9.      * Execute the query and get the first result if it's the sole matching record.
  10.      *
  1.         return $next($request);
  2.     }
  3.     public function getUrlRedirect($url_source)
  4.     {
  5.         return SEOUrlRedirect::where('url_source'$url_source)->where('active'1)->first();
  6.     }
  7. }
  1.     {
  2.         $path '/' $request->path();
  3.         $md5_path md5($path);
  4.         $oRedirect Cache::tags([CacheManager::getTag(),SEOUrlRedirect::CACHE_KEY])->remember($md5_pathCacheManager::CACHE_1DAY, function () use ($path) {
  5.             $oRedirect $this->getUrlRedirect($path);
  6.             return $oRedirect $oRedirect->toArray() : null;
  7.         });
  8.         if (!empty($oRedirect['url_target']) && $oRedirect['url_target'] != $path) {
  9.             return redirect($oRedirect['url_target'], $oRedirect['http_code']);
  1.         // given number of seconds so it's available for all subsequent requests.
  2.         if (! is_null($value)) {
  3.             return $value;
  4.         }
  5.         $this->put($key$value $callback(), $ttl);
  6.         return $value;
  7.     }
  8.     /**
  1.         $md5_path md5($path);
  2.         $oRedirect Cache::tags([CacheManager::getTag(),SEOUrlRedirect::CACHE_KEY])->remember($md5_pathCacheManager::CACHE_1DAY, function () use ($path) {
  3.             $oRedirect $this->getUrlRedirect($path);
  4.             return $oRedirect $oRedirect->toArray() : null;
  5.         });
  6.         if (!empty($oRedirect['url_target']) && $oRedirect['url_target'] != $path) {
  7.             return redirect($oRedirect['url_target'], $oRedirect['http_code']);
  8.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.      */
  2.     public function handle($requestClosure $next)
  3.     {
  4.         $this->clean($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Clean the request's data.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.      */
  2.     public function handle($requestClosure $next)
  3.     {
  4.         $this->clean($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Clean the request's data.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         if ($max && $request->server('CONTENT_LENGTH') > $max) {
  2.             throw new PostTooLargeException;
  3.         }
  4.         return $next($request);
  5.     }
  6.     /**
  7.      * Determine the server 'post_max_size' as bytes.
  8.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.                 null,
  2.                 isset($data['retry']) ? ['Retry-After' => $data['retry']] : []
  3.             );
  4.         }
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Determine if the incoming request has a maintenance mode bypass cookie.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.                 $this->addHeaders($event->request$event->response);
  2.             });
  3.         }
  4.         // Handle the request
  5.         $response $next($request);
  6.         if ($request->getMethod() === 'OPTIONS') {
  7.             $this->cors->varyHeader($response'Access-Control-Request-Method');
  8.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.     public function handle(Request $requestClosure $next)
  2.     {
  3.         $request::setTrustedProxies([], $this->getTrustedHeaderNames()); // Reset trusted proxies between requests
  4.         $this->setTrustedProxyIpAddresses($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Sets the trusted proxies on the request to the value of trustedproxy.proxies
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.         $this->bootstrap();
  2.         return (new Pipeline($this->app))
  3.                     ->send($request)
  4.                     ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5.                     ->then($this->dispatchToRouter());
  6.     }
  7.     /**
  8.      * Bootstrap the application for HTTP requests.
  9.      *
  1.     public function handle($request)
  2.     {
  3.         try {
  4.             $request->enableHttpMethodParameterOverride();
  5.             $response $this->sendRequestThroughRouter($request);
  6.         } catch (Throwable $e) {
  7.             $this->reportException($e);
  8.             $response $this->renderException($request$e);
  9.         }
  1. $app = require_once __DIR__.'/../bootstrap/app.php';
  2. $kernel $app->make(Kernel::class);
  3. $response tap($kernel->handle(
  4.     $request Request::capture()
  5. ))->send();
  6. $kernel->terminate($request$response);

PDOException

SQLSTATE[HY000] [2002] Connection refused

  1.     {
  2.         if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
  3.             return new PDOConnection($dsn$username$password$options);
  4.         }
  5.         return new PDO($dsn$username$password$options);
  6.     }
  7.     /**
  8.      * Determine if the connection is persistent.
  9.      *
  1.     {
  2.         if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
  3.             return new PDOConnection($dsn$username$password$options);
  4.         }
  5.         return new PDO($dsn$username$password$options);
  6.     }
  7.     /**
  8.      * Determine if the connection is persistent.
  9.      *
  1.      * @throws \Exception
  2.      */
  3.     protected function tryAgainIfCausedByLostConnection(Throwable $e$dsn$username$password$options)
  4.     {
  5.         if ($this->causedByLostConnection($e)) {
  6.             return $this->createPdoConnection($dsn$username$password$options);
  7.         }
  8.         throw $e;
  9.     }
  1.             return $this->createPdoConnection(
  2.                 $dsn$username$password$options
  3.             );
  4.         } catch (Exception $e) {
  5.             return $this->tryAgainIfCausedByLostConnection(
  6.                 $e$dsn$username$password$options
  7.             );
  8.         }
  9.     }
  10.     /**
  1.         $options $this->getOptions($config);
  2.         // We need to grab the PDO options that should be used while making the brand
  3.         // new connection instance. The PDO options control various aspects of the
  4.         // connection's behavior, and some might be specified by the developers.
  5.         $connection $this->createConnection($dsn$config$options);
  6.         if (! empty($config['database'])) {
  7.             $connection->exec("use `{$config['database']}`;");
  8.         }
  1.         return function () use ($config) {
  2.             foreach (Arr::shuffle($hosts $this->parseHosts($config)) as $key => $host) {
  3.                 $config['host'] = $host;
  4.                 try {
  5.                     return $this->createConnector($config)->connect($config);
  6.                 } catch (PDOException $e) {
  7.                     continue;
  8.                 }
  9.             }
ConnectionFactory->Illuminate\Database\Connectors\{closure}()
  1.      * @return \PDO
  2.      */
  3.     public function getPdo()
  4.     {
  5.         if ($this->pdo instanceof Closure) {
  6.             return $this->pdo call_user_func($this->pdo);
  7.         }
  8.         return $this->pdo;
  9.     }
  1.         if ($this->readPdo instanceof Closure) {
  2.             return $this->readPdo call_user_func($this->readPdo);
  3.         }
  4.         return $this->readPdo ?: $this->getPdo();
  5.     }
  6.     /**
  7.      * Get the current read PDO connection parameter without executing any reconnect logic.
  8.      *
  1.      * @param  bool  $useReadPdo
  2.      * @return \PDO
  3.      */
  4.     protected function getPdoForSelect($useReadPdo true)
  5.     {
  6.         return $useReadPdo $this->getReadPdo() : $this->getPdo();
  7.     }
  8.     /**
  9.      * Run an insert statement against the database.
  10.      *
  1.             // For select statements, we'll simply execute the query and return an array
  2.             // of the database result set. Each element in the array will be a single
  3.             // row from the database table, and will either be an array or objects.
  4.             $statement $this->prepared(
  5.                 $this->getPdoForSelect($useReadPdo)->prepare($query)
  6.             );
  7.             $this->bindValues($statement$this->prepareBindings($bindings));
  8.             $statement->execute();
  1.     {
  2.         // To execute the statement, we'll simply call the callback, which will actually
  3.         // run the SQL against the PDO connection. Then we can calculate the time it
  4.         // took to execute and log the query SQL, bindings and time in our memory.
  5.         try {
  6.             $result $callback($query$bindings);
  7.         }
  8.         // If an exception occurs when attempting to run a query, we'll format the error
  9.         // message to include the bindings with SQL, which will make this exception a
  10.         // lot more helpful to the developer instead of just the database's errors.
  1.     protected function tryAgainIfCausedByLostConnection(QueryException $e$query$bindingsClosure $callback)
  2.     {
  3.         if ($this->causedByLostConnection($e->getPrevious())) {
  4.             $this->reconnect();
  5.             return $this->runQueryCallback($query$bindings$callback);
  6.         }
  7.         throw $e;
  8.     }
  1.         if ($this->transactions >= 1) {
  2.             throw $e;
  3.         }
  4.         return $this->tryAgainIfCausedByLostConnection(
  5.             $e$query$bindings$callback
  6.         );
  7.     }
  8.     /**
  9.      * Handle a query exception that occurred during query execution.
  1.         // to re-establish connection and re-run the query with a fresh connection.
  2.         try {
  3.             $result $this->runQueryCallback($query$bindings$callback);
  4.         } catch (QueryException $e) {
  5.             $result $this->handleQueryException(
  6.                 $e$query$bindings$callback
  7.             );
  8.         }
  9.         // Once we have run the query we will calculate the time that it took to run and
  10.         // then log the query, bindings, and execution time so we will report them on
  1.             $this->bindValues($statement$this->prepareBindings($bindings));
  2.             $statement->execute();
  3.             return $statement->fetchAll();
  4.         });
  5.     }
  6.     /**
  7.      * Run a select statement against the database and returns a generator.
  8.      *
  1.      * @return array
  2.      */
  3.     protected function runSelect()
  4.     {
  5.         return $this->connection->select(
  6.             $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  7.         );
  8.     }
  9.     /**
  10.      * Paginate the given query into a simple paginator.
  1.      * @return \Illuminate\Support\Collection
  2.      */
  3.     public function get($columns = ['*'])
  4.     {
  5.         return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  6.             return $this->processor->processSelect($this$this->runSelect());
  7.         }));
  8.     }
  9.     /**
  10.      * Run the query as a "select" statement against the connection.
  1.         if (is_null($original)) {
  2.             $this->columns $columns;
  3.         }
  4.         $result $callback();
  5.         $this->columns $original;
  6.         return $result;
  7.     }
  1.      */
  2.     public function get($columns = ['*'])
  3.     {
  4.         return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  5.             return $this->processor->processSelect($this$this->runSelect());
  6.         }));
  7.     }
  8.     /**
  9.      * Run the query as a "select" statement against the connection.
  10.      *
  1.      * @return \Illuminate\Database\Eloquent\Model[]|static[]
  2.      */
  3.     public function getModels($columns = ['*'])
  4.     {
  5.         return $this->model->hydrate(
  6.             $this->query->get($columns)->all()
  7.         )->all();
  8.     }
  9.     /**
  10.      * Eager load the relationships for the models.
  1.         $builder $this->applyScopes();
  2.         // If we actually found models we will also eager load any relationships that
  3.         // have been specified as needing to be eager loaded, which will solve the
  4.         // n+1 query issue for the developers to avoid running a lot of queries.
  5.         if (count($models $builder->getModels($columns)) > 0) {
  6.             $models $builder->eagerLoadRelations($models);
  7.         }
  8.         return $builder->getModel()->newCollection($models);
  9.     }
  1.      * @param  array|string  $columns
  2.      * @return \Illuminate\Database\Eloquent\Model|object|static|null
  3.      */
  4.     public function first($columns = ['*'])
  5.     {
  6.         return $this->take(1)->get($columns)->first();
  7.     }
  8.     /**
  9.      * Execute the query and get the first result if it's the sole matching record.
  10.      *
  1.         return $next($request);
  2.     }
  3.     public function getUrlRedirect($url_source)
  4.     {
  5.         return SEOUrlRedirect::where('url_source'$url_source)->where('active'1)->first();
  6.     }
  7. }
  1.     {
  2.         $path '/' $request->path();
  3.         $md5_path md5($path);
  4.         $oRedirect Cache::tags([CacheManager::getTag(),SEOUrlRedirect::CACHE_KEY])->remember($md5_pathCacheManager::CACHE_1DAY, function () use ($path) {
  5.             $oRedirect $this->getUrlRedirect($path);
  6.             return $oRedirect $oRedirect->toArray() : null;
  7.         });
  8.         if (!empty($oRedirect['url_target']) && $oRedirect['url_target'] != $path) {
  9.             return redirect($oRedirect['url_target'], $oRedirect['http_code']);
  1.         // given number of seconds so it's available for all subsequent requests.
  2.         if (! is_null($value)) {
  3.             return $value;
  4.         }
  5.         $this->put($key$value $callback(), $ttl);
  6.         return $value;
  7.     }
  8.     /**
  1.         $md5_path md5($path);
  2.         $oRedirect Cache::tags([CacheManager::getTag(),SEOUrlRedirect::CACHE_KEY])->remember($md5_pathCacheManager::CACHE_1DAY, function () use ($path) {
  3.             $oRedirect $this->getUrlRedirect($path);
  4.             return $oRedirect $oRedirect->toArray() : null;
  5.         });
  6.         if (!empty($oRedirect['url_target']) && $oRedirect['url_target'] != $path) {
  7.             return redirect($oRedirect['url_target'], $oRedirect['http_code']);
  8.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.      */
  2.     public function handle($requestClosure $next)
  3.     {
  4.         $this->clean($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Clean the request's data.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.      */
  2.     public function handle($requestClosure $next)
  3.     {
  4.         $this->clean($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Clean the request's data.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         if ($max && $request->server('CONTENT_LENGTH') > $max) {
  2.             throw new PostTooLargeException;
  3.         }
  4.         return $next($request);
  5.     }
  6.     /**
  7.      * Determine the server 'post_max_size' as bytes.
  8.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.                 null,
  2.                 isset($data['retry']) ? ['Retry-After' => $data['retry']] : []
  3.             );
  4.         }
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Determine if the incoming request has a maintenance mode bypass cookie.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.                 $this->addHeaders($event->request$event->response);
  2.             });
  3.         }
  4.         // Handle the request
  5.         $response $next($request);
  6.         if ($request->getMethod() === 'OPTIONS') {
  7.             $this->cors->varyHeader($response'Access-Control-Request-Method');
  8.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.     public function handle(Request $requestClosure $next)
  2.     {
  3.         $request::setTrustedProxies([], $this->getTrustedHeaderNames()); // Reset trusted proxies between requests
  4.         $this->setTrustedProxyIpAddresses($request);
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * Sets the trusted proxies on the request to the value of trustedproxy.proxies
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.         $this->bootstrap();
  2.         return (new Pipeline($this->app))
  3.                     ->send($request)
  4.                     ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5.                     ->then($this->dispatchToRouter());
  6.     }
  7.     /**
  8.      * Bootstrap the application for HTTP requests.
  9.      *
  1.     public function handle($request)
  2.     {
  3.         try {
  4.             $request->enableHttpMethodParameterOverride();
  5.             $response $this->sendRequestThroughRouter($request);
  6.         } catch (Throwable $e) {
  7.             $this->reportException($e);
  8.             $response $this->renderException($request$e);
  9.         }
  1. $app = require_once __DIR__.'/../bootstrap/app.php';
  2. $kernel $app->make(Kernel::class);
  3. $response tap($kernel->handle(
  4.     $request Request::capture()
  5. ))->send();
  6. $kernel->terminate($request$response);

Stack Traces 2

[2/2] QueryException

Illuminate\Database\QueryException:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `seo_urls_redirect` where `url_source` = /nang-cao-hieu-qua-giam-sat and `active` = 1 limit 1)

  at /homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
  at Illuminate\Database\Connection->runQueryCallback()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:752)
  at Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:732)
  at Illuminate\Database\Connection->handleQueryException()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:641)
  at Illuminate\Database\Connection->run()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:346)
  at Illuminate\Database\Connection->select()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2313)
  at Illuminate\Database\Query\Builder->runSelect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2301)
  at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2796)
  at Illuminate\Database\Query\Builder->onceWithColumns()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2302)
  at Illuminate\Database\Query\Builder->get()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:571)
  at Illuminate\Database\Eloquent\Builder->getModels()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:555)
  at Illuminate\Database\Eloquent\Builder->get()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:149)
  at Illuminate\Database\Eloquent\Builder->first()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:39)
  at Modules\System\Http\Middleware\RedirectRequests->getUrlRedirect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:26)
  at Modules\System\Http\Middleware\RedirectRequests->Modules\System\Http\Middleware\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:385)
  at Illuminate\Cache\Repository->remember()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:28)
  at Modules\System\Http\Middleware\RedirectRequests->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:86)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/fruitcake/laravel-cors/src/HandleCors.php:57)
  at Fruitcake\Cors\HandleCors->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/fideloper/proxy/src/TrustProxies.php:57)
  at Fideloper\Proxy\TrustProxies->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:141)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/public/index.php:52)                

[1/2] PDOException

PDOException:
SQLSTATE[HY000] [2002] Connection refused

  at /homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
  at PDO->__construct()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70)
  at Illuminate\Database\Connectors\Connector->createPdoConnection()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:100)
  at Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:50)
  at Illuminate\Database\Connectors\Connector->createConnection()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:24)
  at Illuminate\Database\Connectors\MySqlConnector->connect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:184)
  at Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
  at call_user_func()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:939)
  at Illuminate\Database\Connection->getPdo()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:974)
  at Illuminate\Database\Connection->getReadPdo()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:412)
  at Illuminate\Database\Connection->getPdoForSelect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:338)
  at Illuminate\Database\Connection->Illuminate\Database\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671)
  at Illuminate\Database\Connection->runQueryCallback()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:752)
  at Illuminate\Database\Connection->tryAgainIfCausedByLostConnection()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:732)
  at Illuminate\Database\Connection->handleQueryException()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:641)
  at Illuminate\Database\Connection->run()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:346)
  at Illuminate\Database\Connection->select()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2313)
  at Illuminate\Database\Query\Builder->runSelect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2301)
  at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2796)
  at Illuminate\Database\Query\Builder->onceWithColumns()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2302)
  at Illuminate\Database\Query\Builder->get()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:571)
  at Illuminate\Database\Eloquent\Builder->getModels()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:555)
  at Illuminate\Database\Eloquent\Builder->get()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:149)
  at Illuminate\Database\Eloquent\Builder->first()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:39)
  at Modules\System\Http\Middleware\RedirectRequests->getUrlRedirect()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:26)
  at Modules\System\Http\Middleware\RedirectRequests->Modules\System\Http\Middleware\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:385)
  at Illuminate\Cache\Repository->remember()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/Modules/System/Http/Middleware/RedirectRequests.php:28)
  at Modules\System\Http\Middleware\RedirectRequests->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:86)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/fruitcake/laravel-cors/src/HandleCors.php:57)
  at Fruitcake\Cors\HandleCors->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/fideloper/proxy/src/TrustProxies.php:57)
  at Fideloper\Proxy\TrustProxies->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:141)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/homesun/thplus/domains/thuonghieuplus.vn/public_html/public/index.php:52)