Cỏ Lông Chông

PDOException QueryException

HTTP 500 Internal Server Error

SQLSTATE[08004] [1040] Too many connections (SQL: select * from `routers` where `rou_name` = web.raovat.raovat_search_1 limit 1)

Exceptions 2

Illuminate\Database\ QueryException

in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php (line 712)
  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. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> runQueryCallback (line 672)
  1. // Here we will run this query. If an exception occurs we'll determine if it was
  2. // caused by a connection that has been lost. If that is the cause, we'll try
  3. // to re-establish connection and re-run the query with a fresh connection.
  4. try {
  5. $result = $this->runQueryCallback($query, $bindings, $callback);
  6. } catch (QueryException $e) {
  7. $result = $this->handleQueryException(
  8. $e, $query, $bindings, $callback
  9. );
  10. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> run (line 359)
  1. * @param bool $useReadPdo
  2. * @return array
  3. */
  4. public function select($query, $bindings = [], $useReadPdo = true)
  5. {
  6. return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
  7. if ($this->pretending()) {
  8. return [];
  9. }
  10. // For select statements, we'll simply execute the query and return an array
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> select (line 2413)
  1. *
  2. * @return array
  3. */
  4. protected function runSelect()
  5. {
  6. return $this->connection->select(
  7. $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  8. );
  9. }
  10. /**
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> runSelect (line 2402)
  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.
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> Illuminate\Database\Query\{closure} (line 2936)
  1. if (is_null($original)) {
  2. $this->columns = $columns;
  3. }
  4. $result = $callback();
  5. $this->columns = $original;
  6. return $result;
  7. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> onceWithColumns (line 2401)
  1. * @param array|string $columns
  2. * @return \Illuminate\Support\Collection
  3. */
  4. public function get($columns = ['*'])
  5. {
  6. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  7. return $this->processor->processSelect($this, $this->runSelect());
  8. }));
  9. }
  10. /**
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php -> get (line 625)
  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.
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php -> getModels (line 609)
  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. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Concerns/BuildsQueries.php -> get (line 294)
  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. *
Builder->first() in /var/www/vatgia.com.old/master/app/Repositories/Admin/Permission/RouterRepository.php (line 31)
  1. public function getById($id){
  2. return $this->model->find($id);
  3. }
  4. public function getByName($name){
  5. return $this->model->where('rou_name', $name)->first();
  6. }
  7. }
RouterRepository->getByName() in /var/www/vatgia.com.old/master/app/Http/Middleware/AuthenticateRouter.php (line 31)
  1. // lấy tên router
  2. $nameRouter = $request->route()[1]['as'];
  3. // lấy thông tin router trên db
  4. $router = (new RouterRepository)->getByName($nameRouter);
  5. // phân loại router là web hay api
  6. if($router){
  7. $rou_classify = $router->rou_classify;
  8. }else{
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> handle (line 167)
  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);
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Illuminate\Pipeline\{closure} (line 30)
  1. return function ($stack, $pipe) {
  2. return function ($passable) use ($stack, $pipe) {
  3. try {
  4. $slice = parent::carry();
  5. return ($slice($stack, $pipe))($passable);
  6. } catch (Throwable $e) {
  7. return $this->handleException($passable, $e);
  8. }
  9. };
  10. };
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  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. *
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> then (line 426)
  1. {
  2. if (count($middleware) > 0 && ! $this->shouldSkipMiddleware()) {
  3. return (new Pipeline($this))
  4. ->send($this->make('request'))
  5. ->through($middleware)
  6. ->then($then);
  7. }
  8. return $then($this->make('request'));
  9. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> sendThroughPipeline (line 261)
  1. // Pipe through route middleware...
  2. if (isset($action['middleware'])) {
  3. $middleware = $this->gatherMiddlewareClassNames($action['middleware']);
  4. return $this->prepareResponse($this->sendThroughPipeline($middleware, function () {
  5. return $this->callActionOnArrayBasedRoute($this['request']->route());
  6. }));
  7. }
  8. return $this->prepareResponse(
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> handleFoundRoute (line 237)
  1. case Dispatcher::NOT_FOUND:
  2. throw new NotFoundHttpException;
  3. case Dispatcher::METHOD_NOT_ALLOWED:
  4. throw new MethodNotAllowedHttpException($routeInfo[1]);
  5. case Dispatcher::FOUND:
  6. return $this->handleFoundRoute($routeInfo);
  7. }
  8. }
  9. /**
  10. * Handle a route found by the dispatcher.
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> handleDispatcherResponse (line 172)
  1. if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2. return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3. }
  4. return $this->handleDispatcherResponse(
  5. $this->createDispatcher()->dispatch($method, $pathInfo)
  6. );
  7. });
  8. } catch (Throwable $e) {
  9. return $this->prepareResponse($this->sendExceptionToHandler($e));
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Laravel\Lumen\Concerns\{closure} (line 48)
  1. */
  2. protected function prepareDestination(BaseClosure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
Pipeline->Laravel\Lumen\Routing\{closure}() in /var/www/vatgia.com.old/master/app/Http/Middleware/CorsMiddleware.php (line 33)
  1. if ($request->isMethod('OPTIONS'))
  2. {
  3. return response()->json('{"method":"OPTIONS"}', 200, $headers);
  4. }
  5. $response = $next($request);
  6. foreach($headers as $key => $value)
  7. {
  8. $response->header($key, $value);
  9. }
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> handle (line 167)
  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);
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Illuminate\Pipeline\{closure} (line 30)
  1. return function ($stack, $pipe) {
  2. return function ($passable) use ($stack, $pipe) {
  3. try {
  4. $slice = parent::carry();
  5. return ($slice($stack, $pipe))($passable);
  6. } catch (Throwable $e) {
  7. return $this->handleException($passable, $e);
  8. }
  9. };
  10. };
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  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. *
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> then (line 426)
  1. {
  2. if (count($middleware) > 0 && ! $this->shouldSkipMiddleware()) {
  3. return (new Pipeline($this))
  4. ->send($this->make('request'))
  5. ->through($middleware)
  6. ->then($then);
  7. }
  8. return $then($this->make('request'));
  9. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> sendThroughPipeline (line 165)
  1. [$method, $pathInfo] = $this->parseIncomingRequest($request);
  2. try {
  3. $this->boot();
  4. return $this->sendThroughPipeline($this->middleware, function ($request) use ($method, $pathInfo) {
  5. $this->instance(Request::class, $request);
  6. if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  7. return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  8. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> dispatch (line 112)
  1. * @param \Symfony\Component\HttpFoundation\Request|null $request
  2. * @return void
  3. */
  4. public function run($request = null)
  5. {
  6. $response = $this->dispatch($request);
  7. if ($response instanceof SymfonyResponse) {
  8. $response->send();
  9. } else {
  10. echo (string) $response;
Application->run() in /var/www/vatgia.com.old/master/public/index.php (line 45)
  1. * -------------------------------------------------------------
  2. * Chúng ta dùng output buffer để chèn thêm HTML hiển thị thời gian
  3. * vào cuối trang mà không ảnh hưởng tới cấu trúc Laravel.
  4. * -------------------------------------------------------------
  5. */
  6. $app->run();

PDOException

SQLSTATE[08004] [1040] Too many connections

in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php (line 70)
  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. *
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php -> __construct (line 70)
  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. *
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php -> createPdoConnection (line 45)
  1. [$username, $password] = [
  2. $config['username'] ?? null, $config['password'] ?? null,
  3. ];
  4. try {
  5. return $this->createPdoConnection(
  6. $dsn, $username, $password, $options
  7. );
  8. } catch (Exception $e) {
  9. return $this->tryAgainIfCausedByLostConnection(
  10. $e, $dsn, $username, $password, $options
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/MySqlConnector.php -> createConnection (line 24)
  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. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/ConnectionFactory.php -> connect (line 184)
  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}() in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php call_user_func (line 1064)
  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. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> getPdo (line 1100)
  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. *
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> getReadPdo (line 442)
  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. *
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> getPdoForSelect (line 368)
  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();
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> Illuminate\Database\{closure} (line 705)
  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. return $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.
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> runQueryCallback (line 672)
  1. // Here we will run this query. If an exception occurs we'll determine if it was
  2. // caused by a connection that has been lost. If that is the cause, we'll try
  3. // to re-establish connection and re-run the query with a fresh connection.
  4. try {
  5. $result = $this->runQueryCallback($query, $bindings, $callback);
  6. } catch (QueryException $e) {
  7. $result = $this->handleQueryException(
  8. $e, $query, $bindings, $callback
  9. );
  10. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php -> run (line 359)
  1. * @param bool $useReadPdo
  2. * @return array
  3. */
  4. public function select($query, $bindings = [], $useReadPdo = true)
  5. {
  6. return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
  7. if ($this->pretending()) {
  8. return [];
  9. }
  10. // For select statements, we'll simply execute the query and return an array
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> select (line 2413)
  1. *
  2. * @return array
  3. */
  4. protected function runSelect()
  5. {
  6. return $this->connection->select(
  7. $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  8. );
  9. }
  10. /**
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> runSelect (line 2402)
  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.
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> Illuminate\Database\Query\{closure} (line 2936)
  1. if (is_null($original)) {
  2. $this->columns = $columns;
  3. }
  4. $result = $callback();
  5. $this->columns = $original;
  6. return $result;
  7. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php -> onceWithColumns (line 2401)
  1. * @param array|string $columns
  2. * @return \Illuminate\Support\Collection
  3. */
  4. public function get($columns = ['*'])
  5. {
  6. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  7. return $this->processor->processSelect($this, $this->runSelect());
  8. }));
  9. }
  10. /**
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php -> get (line 625)
  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.
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php -> getModels (line 609)
  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. }
in /var/www/vatgia.com.old/master/vendor/illuminate/database/Concerns/BuildsQueries.php -> get (line 294)
  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. *
Builder->first() in /var/www/vatgia.com.old/master/app/Repositories/Admin/Permission/RouterRepository.php (line 31)
  1. public function getById($id){
  2. return $this->model->find($id);
  3. }
  4. public function getByName($name){
  5. return $this->model->where('rou_name', $name)->first();
  6. }
  7. }
RouterRepository->getByName() in /var/www/vatgia.com.old/master/app/Http/Middleware/AuthenticateRouter.php (line 31)
  1. // lấy tên router
  2. $nameRouter = $request->route()[1]['as'];
  3. // lấy thông tin router trên db
  4. $router = (new RouterRepository)->getByName($nameRouter);
  5. // phân loại router là web hay api
  6. if($router){
  7. $rou_classify = $router->rou_classify;
  8. }else{
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> handle (line 167)
  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);
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Illuminate\Pipeline\{closure} (line 30)
  1. return function ($stack, $pipe) {
  2. return function ($passable) use ($stack, $pipe) {
  3. try {
  4. $slice = parent::carry();
  5. return ($slice($stack, $pipe))($passable);
  6. } catch (Throwable $e) {
  7. return $this->handleException($passable, $e);
  8. }
  9. };
  10. };
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  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. *
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> then (line 426)
  1. {
  2. if (count($middleware) > 0 && ! $this->shouldSkipMiddleware()) {
  3. return (new Pipeline($this))
  4. ->send($this->make('request'))
  5. ->through($middleware)
  6. ->then($then);
  7. }
  8. return $then($this->make('request'));
  9. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> sendThroughPipeline (line 261)
  1. // Pipe through route middleware...
  2. if (isset($action['middleware'])) {
  3. $middleware = $this->gatherMiddlewareClassNames($action['middleware']);
  4. return $this->prepareResponse($this->sendThroughPipeline($middleware, function () {
  5. return $this->callActionOnArrayBasedRoute($this['request']->route());
  6. }));
  7. }
  8. return $this->prepareResponse(
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> handleFoundRoute (line 237)
  1. case Dispatcher::NOT_FOUND:
  2. throw new NotFoundHttpException;
  3. case Dispatcher::METHOD_NOT_ALLOWED:
  4. throw new MethodNotAllowedHttpException($routeInfo[1]);
  5. case Dispatcher::FOUND:
  6. return $this->handleFoundRoute($routeInfo);
  7. }
  8. }
  9. /**
  10. * Handle a route found by the dispatcher.
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> handleDispatcherResponse (line 172)
  1. if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2. return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3. }
  4. return $this->handleDispatcherResponse(
  5. $this->createDispatcher()->dispatch($method, $pathInfo)
  6. );
  7. });
  8. } catch (Throwable $e) {
  9. return $this->prepareResponse($this->sendExceptionToHandler($e));
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Laravel\Lumen\Concerns\{closure} (line 48)
  1. */
  2. protected function prepareDestination(BaseClosure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
Pipeline->Laravel\Lumen\Routing\{closure}() in /var/www/vatgia.com.old/master/app/Http/Middleware/CorsMiddleware.php (line 33)
  1. if ($request->isMethod('OPTIONS'))
  2. {
  3. return response()->json('{"method":"OPTIONS"}', 200, $headers);
  4. }
  5. $response = $next($request);
  6. foreach($headers as $key => $value)
  7. {
  8. $response->header($key, $value);
  9. }
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> handle (line 167)
  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);
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php -> Illuminate\Pipeline\{closure} (line 30)
  1. return function ($stack, $pipe) {
  2. return function ($passable) use ($stack, $pipe) {
  3. try {
  4. $slice = parent::carry();
  5. return ($slice($stack, $pipe))($passable);
  6. } catch (Throwable $e) {
  7. return $this->handleException($passable, $e);
  8. }
  9. };
  10. };
in /var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  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. *
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> then (line 426)
  1. {
  2. if (count($middleware) > 0 && ! $this->shouldSkipMiddleware()) {
  3. return (new Pipeline($this))
  4. ->send($this->make('request'))
  5. ->through($middleware)
  6. ->then($then);
  7. }
  8. return $then($this->make('request'));
  9. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> sendThroughPipeline (line 165)
  1. [$method, $pathInfo] = $this->parseIncomingRequest($request);
  2. try {
  3. $this->boot();
  4. return $this->sendThroughPipeline($this->middleware, function ($request) use ($method, $pathInfo) {
  5. $this->instance(Request::class, $request);
  6. if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  7. return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  8. }
in /var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php -> dispatch (line 112)
  1. * @param \Symfony\Component\HttpFoundation\Request|null $request
  2. * @return void
  3. */
  4. public function run($request = null)
  5. {
  6. $response = $this->dispatch($request);
  7. if ($response instanceof SymfonyResponse) {
  8. $response->send();
  9. } else {
  10. echo (string) $response;
Application->run() in /var/www/vatgia.com.old/master/public/index.php (line 45)
  1. * -------------------------------------------------------------
  2. * Chúng ta dùng output buffer để chèn thêm HTML hiển thị thời gian
  3. * vào cuối trang mà không ảnh hưởng tới cấu trúc Laravel.
  4. * -------------------------------------------------------------
  5. */
  6. $app->run();

Stack Traces 2

[2/2] QueryException
Illuminate\Database\QueryException: SQLSTATE[08004] [1040] Too many connections (SQL: select * from `routers` where `rou_name` = web.raovat.raovat_search_1 limit 1) at /var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:712 at Illuminate\Database\Connection->runQueryCallback() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:672) at Illuminate\Database\Connection->run() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:359) at Illuminate\Database\Connection->select() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2413) at Illuminate\Database\Query\Builder->runSelect() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2402) at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2936) at Illuminate\Database\Query\Builder->onceWithColumns() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2401) at Illuminate\Database\Query\Builder->get() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php:625) at Illuminate\Database\Eloquent\Builder->getModels() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php:609) at Illuminate\Database\Eloquent\Builder->get() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Concerns/BuildsQueries.php:294) at Illuminate\Database\Eloquent\Builder->first() (/var/www/vatgia.com.old/master/app/Repositories/Admin/Permission/RouterRepository.php:31) at App\Repositories\Admin\Permission\RouterRepository->getByName() (/var/www/vatgia.com.old/master/app/Http/Middleware/AuthenticateRouter.php:31) at App\Http\Middleware\AuthenticateRouter->handle() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426) at Laravel\Lumen\Application->sendThroughPipeline() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:261) at Laravel\Lumen\Application->handleFoundRoute() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/app/Http/Middleware/CorsMiddleware.php:33) at App\Http\Middleware\CorsMiddleware->handle() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426) at Laravel\Lumen\Application->sendThroughPipeline() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:165) at Laravel\Lumen\Application->dispatch() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/var/www/vatgia.com.old/master/public/index.php:45)
[1/2] PDOException
PDOException: SQLSTATE[08004] [1040] Too many connections at /var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php:70 at PDO->__construct() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php:70) at Illuminate\Database\Connectors\Connector->createPdoConnection() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/Connector.php:45) at Illuminate\Database\Connectors\Connector->createConnection() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/MySqlConnector.php:24) at Illuminate\Database\Connectors\MySqlConnector->connect() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connectors/ConnectionFactory.php:184) at Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() at call_user_func() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:1064) at Illuminate\Database\Connection->getPdo() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:1100) at Illuminate\Database\Connection->getReadPdo() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:442) at Illuminate\Database\Connection->getPdoForSelect() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:368) at Illuminate\Database\Connection->Illuminate\Database\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:705) at Illuminate\Database\Connection->runQueryCallback() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:672) at Illuminate\Database\Connection->run() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Connection.php:359) at Illuminate\Database\Connection->select() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2413) at Illuminate\Database\Query\Builder->runSelect() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2402) at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2936) at Illuminate\Database\Query\Builder->onceWithColumns() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Query/Builder.php:2401) at Illuminate\Database\Query\Builder->get() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php:625) at Illuminate\Database\Eloquent\Builder->getModels() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Eloquent/Builder.php:609) at Illuminate\Database\Eloquent\Builder->get() (/var/www/vatgia.com.old/master/vendor/illuminate/database/Concerns/BuildsQueries.php:294) at Illuminate\Database\Eloquent\Builder->first() (/var/www/vatgia.com.old/master/app/Repositories/Admin/Permission/RouterRepository.php:31) at App\Repositories\Admin\Permission\RouterRepository->getByName() (/var/www/vatgia.com.old/master/app/Http/Middleware/AuthenticateRouter.php:31) at App\Http\Middleware\AuthenticateRouter->handle() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426) at Laravel\Lumen\Application->sendThroughPipeline() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:261) at Laravel\Lumen\Application->handleFoundRoute() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/app/Http/Middleware/CorsMiddleware.php:33) at App\Http\Middleware\CorsMiddleware->handle() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/var/www/vatgia.com.old/master/vendor/illuminate/pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426) at Laravel\Lumen\Application->sendThroughPipeline() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:165) at Laravel\Lumen\Application->dispatch() (/var/www/vatgia.com.old/master/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/var/www/vatgia.com.old/master/public/index.php:45)

Từ khóa » Cỏ Lông Chông Tập 1