http://ads.safarmarket.com/api/banner/v1/cpc?destination=1746&dim=300-250&origin=&platform=mobile&prod=tour&zone=

Exceptions

Redis connection failed: Connection refused

  • Exception
  • Logs
  • Stack Trace

Symfony\Component\Cache\Exception\ InvalidArgumentException

  1.                     if ($params['tcp_keepalive'] && \defined('Redis::OPT_TCP_KEEPALIVE')) {
  2.                         $redis->setOption(\Redis::OPT_TCP_KEEPALIVE$params['tcp_keepalive']);
  3.                     }
  4.                 } catch (\RedisException $e) {
  5.                     throw new InvalidArgumentException('Redis connection failed: '.$e->getMessage());
  6.                 }
  7.                 return true;
  8.             };
in vendor/symfony/cache/Traits/RedisTrait.php :: Symfony\Component\Cache\Traits\{closure} (line 314)
  1.             };
  2.             if ($params['lazy']) {
  3.                 $redis = new RedisProxy($redis$initializer);
  4.             } else {
  5.                 $initializer($redis);
  6.             }
  7.         } elseif (is_a($class\RedisArray::class, true)) {
  8.             foreach ($hosts as $i => $host) {
  9.                 switch ($host['scheme']) {
  10.                     case 'tcp'$hosts[$i] = $host['host'].':'.$host['port']; break;
RedisAdapter::createConnection() in src/Service/TourCpcBanner.php (line 39)
  1.     public function getBanner(string $dimensionstring $zonestring $originstring $destinationstring $device)
  2.     {
  3.         $cache = new RedisAdapter(
  4.             RedisAdapter::createConnection('redis://localhost'),
  5.             'tour-cpc-view',
  6.             $defaultLifetime 60
  7.         );
  8.         $cacheKey "{$dimension}-{$zone}-{$origin}-{$destination}-{$device}";
  9.         $cachedMedia $cache->get($cacheKey,function (ItemInterface $item) use ($origin,$destination,$zone,$dimension,$device){
TourCpcBanner->getBanner() in src/Controller/Api/Banner/V1/CpcViewController.php (line 46)
  1.             }else{
  2.                 return $this->json(['status'=>"success","data"=>null],200,$cors);
  3.             }
  4.         }else if($request->get('prod') == 'tour'){
  5.             $banner $this->tourCpcBanner;
  6.             $availableBanner $banner->getBanner($request->get('dim'),$request->get('zone'),$request->get('origin'),$request->get('destination'),$request->get('platform'));
  7.             if(!empty($availableBanner)) {
  8.             return $this->json(['status'=>"success",'data'=>['image'=>$availableBanner['file'],'link'=>$_ENV['BASE_URL'].'api/banner/v1/click/'.$availableBanner['uid']]],200,$cors);
  9.             }else{
  10.                 return $this->json(['status'=>"success","data"=>null],200,$cors);
  11.             }
  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.     }
Kernel->handle() in public/index.php (line 20)
  1.     Debug::enable();
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);