Symfony Exception

ConnectionTimeoutException

HTTP 500 Internal Server Error

No suitable servers found (`serverSelectionTryOnce` set): [Failed to resolve 'chatbot-db.cluster-cv1cbaz9hcwa.us-east-1.docdb.amazonaws.com']

Exception

MongoDB\Driver\Exception\ ConnectionTimeoutException

  1.     if (! $readPreference instanceof ReadPreference) {
  2.         // TODO: PHPLIB-476: Read transaction read preference once PHPC-1439 is implemented
  3.         $readPreference = new ReadPreference(ReadPreference::RP_PRIMARY);
  4.     }
  5.     return $manager->selectServer($readPreference);
  6. }
  7. /**
  8.  * Performs server selection for an aggregate operation with a write stage. The
  9.  * $options parameter may be modified by reference if a primary read preference
  1.     if (! $readPreference instanceof ReadPreference) {
  2.         // TODO: PHPLIB-476: Read transaction read preference once PHPC-1439 is implemented
  3.         $readPreference = new ReadPreference(ReadPreference::RP_PRIMARY);
  4.     }
  5.     return $manager->selectServer($readPreference);
  6. }
  7. /**
  8.  * Performs server selection for an aggregate operation with a write stage. The
  9.  * $options parameter may be modified by reference if a primary read preference
in /app/vendor/mongodb/mongodb/src/Collection.php MongoDB\select_server (line 639)
  1.     {
  2.         if (! isset($options['readPreference']) && ! is_in_transaction($options)) {
  3.             $options['readPreference'] = $this->readPreference;
  4.         }
  5.         $server select_server($this->manager$options);
  6.         if (! isset($options['readConcern']) && ! is_in_transaction($options)) {
  7.             $options['readConcern'] = $this->readConcern;
  8.         }
Collection->find()
in /app/vendor/jenssegers/mongodb/src/Collection.php call_user_func_array (line 45)
  1.      * @return mixed
  2.      */
  3.     public function __call($method$parameters)
  4.     {
  5.         $start microtime(true);
  6.         $result call_user_func_array([$this->collection$method], $parameters);
  7.         // Once we have run the query we will calculate the time that it took to run and
  8.         // then log the query, bindings, and execution time so we will report them on
  9.         // the event that the developer needs them. We'll log time in milliseconds.
  10.         $time $this->connection->getElapsedTime($start);
  1.             if (count($this->options)) {
  2.                 $options array_merge($options$this->options);
  3.             }
  4.             // Execute query and get MongoCursor
  5.             $cursor $this->collection->find($wheres$options);
  6.             if ($returnLazy) {
  7.                 return LazyCollection::make(function () use ($cursor) {
  8.                     foreach ($cursor as $item) {
  9.                         yield $item;
  1.     /**
  2.      * @inheritdoc
  3.      */
  4.     public function get($columns = [])
  5.     {
  6.         return $this->getFresh($columns);
  7.     }
  8.     /**
  9.      * @inheritdoc
  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.      *
Builder->first() in /app/app/Http/Kernel.php (line 29)
  1. {
  2.     public function handle(Request $requestClosure $next)
  3.     {
  4.         $setting Setting::query()
  5.             ->latest()
  6.             ->first();
  7.         foreach ($setting->toArray() as $key => $value) {
  8.             config()->set(str_replace(' ''.'$key), $value);
  9.         }
  10.         return $next($request);
  11.     }
  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 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> Illuminate\Pipeline\{closure} (line 116)
  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.      *
in gate iogate io -> sendRequestThroughRouter (line 111)
  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.      * @return \Illuminate\Http\Response
  2.      */
  3.     protected function handleRequest(Request $request)
  4.     {
  5.         if ($this->isLaravel()) {
  6.             return $this->getKernel()->handle($request);
  7.         }
  8.         return $this->getApplication()->dispatch($request);
  9.     }
  1.     protected function prepareObResponse(Request $request)
  2.     {
  3.         ob_start();
  4.         // handle request with laravel or lumen
  5.         $response $this->handleRequest($request);
  6.         // prepare content for ob
  7.         $content '';
  8.         $isFile false;
  9.         if ($isStream $response instanceof StreamedResponse) {
  1.         }
  2.         $shouldUseOb $this->config->get('swoole_http.ob_output'true);
  3.         if ($shouldUseOb) {
  4.             return $this->prepareObResponse($request);
  5.         }
  6.         return $this->prepareResponse($request);
  7.     }
  1.             // enable sandbox
  2.             $sandbox->enable();
  3.             // handle request via laravel/lumen's dispatcher
  4.             $illuminateResponse $sandbox->run($illuminateRequest);
  5.             // send response
  6.             Response::make($illuminateResponse$swooleResponse$swooleRequest)->send();
  7.         } catch (Throwable $e) {
  8.             try {

Stack Trace

ConnectionTimeoutException
MongoDB\Driver\Exception\ConnectionTimeoutException:
No suitable servers found (`serverSelectionTryOnce` set): [Failed to resolve 'chatbot-db.cluster-cv1cbaz9hcwa.us-east-1.docdb.amazonaws.com']

  at /app/vendor/mongodb/mongodb/src/functions.php:487
  at MongoDB\Driver\Manager->selectServer()
     (/app/vendor/mongodb/mongodb/src/functions.php:487)
  at MongoDB\select_server()
     (/app/vendor/mongodb/mongodb/src/Collection.php:639)
  at MongoDB\Collection->find()
  at call_user_func_array()
     (/app/vendor/jenssegers/mongodb/src/Collection.php:45)
  at Jenssegers\Mongodb\Collection->__call()
     (/app/vendor/jenssegers/mongodb/src/Query/Builder.php:410)
  at Jenssegers\Mongodb\Query\Builder->getFresh()
     (/app/vendor/jenssegers/mongodb/src/Query/Builder.php:201)
  at Jenssegers\Mongodb\Query\Builder->get()
     (/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:699)
  at Illuminate\Database\Eloquent\Builder->getModels()
     (/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:683)
  at Illuminate\Database\Eloquent\Builder->get()
     (/app/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:296)
  at Illuminate\Database\Eloquent\Builder->first()
     (/app/app/Http/Kernel.php:29)
  at App\Http\Config->handle()
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then()
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:142)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/app/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php:257)
  at SwooleTW\Http\Server\Sandbox->handleRequest()
     (/app/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php:217)
  at SwooleTW\Http\Server\Sandbox->prepareObResponse()
     (/app/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php:179)
  at SwooleTW\Http\Server\Sandbox->run()
     (/app/vendor/swooletw/laravel-swoole/src/Server/Manager.php:225)