https://mirbusin.ru/catalog/prod-85893

Exceptions

Couldn't connect to host, Elasticsearch down?

Exception

Elastica\Exception\Connection\ HttpException

  1.         if ($response->hasFailedShards()) {
  2.             throw new PartialShardFailureException($request$response);
  3.         }
  4.         if ($errorNumber 0) {
  5.             throw new HttpException($errorNumber$request$response);
  6.         }
  7.         return $response;
  8.     }
  1.     public function send(): Response
  2.     {
  3.         $transport $this->getConnection()->getTransportObject();
  4.         // Refactor: Not full toArray needed in exec?
  5.         return $transport->exec($this$this->getConnection()->toArray());
  6.     }
  7.     /**
  8.      * @return array
  9.      */
  1.         $connection $this->getConnection();
  2.         $request $this->_lastRequest = new Request($path$method$data$query$connection$contentType);
  3.         $this->_lastResponse null;
  4.         try {
  5.             $response $this->_lastResponse $request->send();
  6.         } catch (ConnectionException $e) {
  7.             $this->_connectionPool->onFail($connection$e$this);
  8.             $this->_logger->error('Elastica Request Failure', [
  9.                 'exception' => $e,
  10.                 'request' => $e->getRequest()->toArray(),
  1.     {
  2.         if ($this->stopwatch) {
  3.             $this->stopwatch->start('es_request''fos_elastica');
  4.         }
  5.         $response parent::request($path$method$data$query$contentType);
  6.         $responseData $response->getData();
  7.         $transportInfo $response->getTransferInfo();
  8.         $connection $this->getLastRequest()->getConnection();
  9.         $forbiddenHttpCodes $connection->hasConfig('http_error_codes') ? $connection->getConfig('http_error_codes') : [];
in vendor/ruflin/elastica/src/Bulk.php -> request (line 306)
  1.      * @throws BulkResponseException
  2.      * @throws InvalidException
  3.      */
  4.     public function send(): ResponseSet
  5.     {
  6.         $response $this->_client->request($this->getPath(), Request::POST, (string) $this$this->_requestParamsRequest::NDJSON_CONTENT_TYPE);
  7.         return $this->_processResponse($response);
  8.     }
  9.     /**
  1.         $bulk->addDocuments($docsAction::OP_TYPE_UPDATE);
  2.         foreach ($requestParams as $key => $value) {
  3.             $bulk->setRequestParam($key$value);
  4.         }
  5.         return $bulk->send();
  6.     }
  7.     /**
  8.      * Uses _bulk to send documents to the server.
  9.      *
in vendor/ruflin/elastica/src/Index.php -> updateDocuments (line 175)
  1.     {
  2.         foreach ($docs as $doc) {
  3.             $doc->setIndex($this->getName());
  4.         }
  5.         return $this->getClient()->updateDocuments($docs$options);
  6.     }
  7.     /**
  8.      * Update entries in the db based on a query.
  9.      *
  1.             $document->setDocAsUpsert(true);
  2.             $documents[] = $document;
  3.         }
  4.         try {
  5.             $this->index->updateDocuments($documents$this->options);
  6.         } catch (BulkException $e) {
  7.             $this->log($e);
  8.         }
  9.     }
  1.             if (\count($this->scheduledForInsertion)) {
  2.                 $this->objectPersister->insertMany($this->scheduledForInsertion);
  3.                 $this->scheduledForInsertion = [];
  4.             }
  5.             if (\count($this->scheduledForUpdate)) {
  6.                 $this->objectPersister->replaceMany($this->scheduledForUpdate);
  7.                 $this->scheduledForUpdate = [];
  8.             }
  9.             if (\count($this->scheduledForDeletion)) {
  10.                 $this->objectPersister->deleteManyByIdentifiers($this->scheduledForDeletion);
  11.                 $this->scheduledForDeletion = [];
  1.      * Iterating through scheduled actions *after* flushing ensures that the
  2.      * ElasticSearch index will be affected only if the query is successful.
  3.      */
  4.     public function postFlush()
  5.     {
  6.         $this->persistScheduled();
  7.     }
  8.     /**
  9.      * Determines whether or not it is okay to persist now.
  10.      *
  1.         if (!isset($this->initialized[$eventName])) {
  2.             $this->initializeListeners($eventName);
  3.         }
  4.         foreach ($this->listeners[$eventName] as $hash => $listener) {
  5.             $listener->{$this->methods[$eventName][$hash]}($eventArgs);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritdoc}
in vendor/doctrine/orm/src/UnitOfWork.php -> dispatchEvent (line 3815)
  1.     }
  2.     private function dispatchPostFlushEvent(): void
  3.     {
  4.         if ($this->evm->hasListeners(Events::postFlush)) {
  5.             $this->evm->dispatchEvent(Events::postFlush, new PostFlushEventArgs($this->em));
  6.         }
  7.     }
  8.     /**
  9.      * Verifies if two given entities actually are the same based on identifier comparison
in vendor/doctrine/orm/src/UnitOfWork.php -> dispatchPostFlushEvent (line 509)
  1.             }
  2.             $coll->takeSnapshot();
  3.         }
  4.         $this->dispatchPostFlushEvent();
  5.         $this->postCommitCleanup($entity);
  6.     }
  7.     /** @param object|object[]|null $entity */
  1.             );
  2.         }
  3.         $this->errorIfClosed();
  4.         $this->unitOfWork->commit($entity);
  5.     }
  6.     /**
  7.      * Finds an Entity by its identifier.
  8.      *
EntityManager_9a5be93->flush() in src/Repository/ProdViewsRepository.php (line 29)
  1.     public function add(ProdViews $entitybool $flush false): void
  2.     {
  3.         $this->getEntityManager()->persist($entity);
  4.         if ($flush) {
  5.             $this->getEntityManager()->flush();
  6.         }
  7.     }
  8.     public function remove(ProdViews $entitybool $flush false): void
  9.     {
ProdViewsRepository->add() in src/Service/Statistics/ProdView.php (line 20)
  1.     public function addProd(int $prod_id)
  2.     {
  3.         $prodView = new ProdViews();
  4.         $prodView->setProd($prod_id);
  5.         $prodView->setTstamp(time());
  6.         $this->prodViewsRepository->add($prodViewtrue);
  7.     }
  8. }
ProdView->addProd() in src/Controller/CatalogController.php (line 476)
  1.     #[Route('/catalog/prod-{prod_id}'name'prod_cont_no_locale'defaults: ['_locale' => '%app.default_lang%'])]
  2.     #[Route('/{_locale}/catalog/prod-{prod_id}'name'prod_cont'requirements: ['_locale' => '%app.langs%'])]
  3.     public function prodCont(Request $requestModelCat $ModelCatint $prod_id 0): Response
  4.     {
  5.         if ($request->getLocale() == $this->getParameter('app.default_lang')) {
  6.             $bc = ["/" => $this->app->labels->get('home')];
  7.         } else {
  8.             $bc = ["/" $request->getLocale() . "/" => $this->app->labels->get('home')];
  9.         }
  10.         
  11.         $bcc = [];
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         if (!IpUtils::checkIp('127.0.0.1'$trustedProxies)) {
  2.             Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3.         }
  4.         try {
  5.             return $kernel->handle($request$type$catch);
  6.         } finally {
  7.             // restore global state
  8.             Request::setTrustedProxies($trustedProxies$trustedHeaderSet);
  9.         }
  10.     }
  1.         if ($this->surrogate) {
  2.             $this->surrogate->addSurrogateCapability($request);
  3.         }
  4.         // always a "master" request (as the real master request can be in cache)
  5.         $response SubRequestHandler::handle($this->kernel$requestHttpKernelInterface::MAIN_REQUEST$catch);
  6.         /*
  7.          * Support stale-if-error given on Responses or as a config option.
  8.          * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9.          * Cache-Control directives) that
  1.     protected function forward(Request $requestbool $catch falseResponse $entry null): Response
  2.     {
  3.         $this->getKernel()->boot();
  4.         $this->getKernel()->getContainer()->set('cache'$this);
  5.         return parent::forward($request$catch$entry);
  6.     }
  7.     /**
  8.      * Returns an array of options to customize the Cache configuration.
  9.      */
  1.         // avoid that the backend sends no content
  2.         $subRequest->headers->remove('If-Modified-Since');
  3.         $subRequest->headers->remove('If-None-Match');
  4.         $response $this->forward($subRequest$catch);
  5.         if ($response->isCacheable()) {
  6.             $this->store($request$response);
  7.         }
  1.         }
  2.         if (null === $entry) {
  3.             $this->record($request'miss');
  4.             return $this->fetch($request$catch);
  5.         }
  6.         if (!$this->isFreshEnough($request$entry)) {
  7.             $this->record($request'stale');
  1.                 reload the cache by fetching a fresh response and caching it (if possible).
  2.             */
  3.             $this->record($request'reload');
  4.             $response $this->fetch($request$catch);
  5.         } else {
  6.             $response $this->lookup($request$catch);
  7.         }
  8.         $this->restoreResponseBody($request$response);
  9.         if (HttpKernelInterface::MAIN_REQUEST === $type) {
  1.     {
  2.         if (!$this->booted) {
  3.             $container $this->container ?? $this->preBoot();
  4.             if ($container->has('http_cache')) {
  5.                 return $container->get('http_cache')->handle($request$type$catch);
  6.             }
  7.         }
  8.         $this->boot();
  9.         ++$this->requestStackSize;
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 29)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {    
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Stack Trace

HttpException
Elastica\Exception\Connection\HttpException:
Couldn't connect to host, Elasticsearch down?

  at vendor/ruflin/elastica/src/Transport/Http.php:186
  at Elastica\Transport\Http->exec()
     (vendor/ruflin/elastica/src/Request.php:183)
  at Elastica\Request->send()
     (vendor/ruflin/elastica/src/Client.php:545)
  at Elastica\Client->request()
     (vendor/friendsofsymfony/elastica-bundle/src/Elastica/Client.php:63)
  at FOS\ElasticaBundle\Elastica\Client->request()
     (vendor/ruflin/elastica/src/Bulk.php:306)
  at Elastica\Bulk->send()
     (vendor/ruflin/elastica/src/Client.php:230)
  at Elastica\Client->updateDocuments()
     (vendor/ruflin/elastica/src/Index.php:175)
  at Elastica\Index->updateDocuments()
     (vendor/friendsofsymfony/elastica-bundle/src/Persister/ObjectPersister.php:151)
  at FOS\ElasticaBundle\Persister\ObjectPersister->replaceMany()
     (vendor/friendsofsymfony/elastica-bundle/src/Doctrine/Listener.php:180)
  at FOS\ElasticaBundle\Doctrine\Listener->persistScheduled()
     (vendor/friendsofsymfony/elastica-bundle/src/Doctrine/Listener.php:155)
  at FOS\ElasticaBundle\Doctrine\Listener->postFlush()
     (vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:66)
  at Symfony\Bridge\Doctrine\ContainerAwareEventManager->dispatchEvent()
     (vendor/doctrine/orm/src/UnitOfWork.php:3815)
  at Doctrine\ORM\UnitOfWork->dispatchPostFlushEvent()
     (vendor/doctrine/orm/src/UnitOfWork.php:509)
  at Doctrine\ORM\UnitOfWork->commit()
     (vendor/doctrine/orm/src/EntityManager.php:414)
  at Doctrine\ORM\EntityManager->flush()
     (var/cache/dev/ContainerM1Rturz/EntityManager_9a5be93.php:136)
  at ContainerM1Rturz\EntityManager_9a5be93->flush()
     (src/Repository/ProdViewsRepository.php:29)
  at App\Repository\ProdViewsRepository->add()
     (src/Service/Statistics/ProdView.php:20)
  at App\Service\Statistics\ProdView->addProd()
     (src/Controller/CatalogController.php:476)
  at App\Controller\CatalogController->prodCont()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:457)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:71)
  at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:430)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:328)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:212)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php')
     (public/index.php:5)