Symfony Exception

LoaderError InvalidArgumentException

HTTP 500 Internal Server Error

Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form).

Exceptions 2

InvalidArgumentException

  1.         }
  2.         try {
  3.             return $this->environment->loadTemplate((string) $name);
  4.         } catch (LoaderError $e) {
  5.             throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
  6.         }
  7.     }
  8. }
TwigEngine->load('app/catalog/show.html.twig') in vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php (line 50)
  1.      *
  2.      * @throws Error if something went wrong like a thrown exception while rendering the template
  3.      */
  4.     public function render($name, array $parameters = [])
  5.     {
  6.         return $this->load($name)->render($parameters);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      *
TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php (line 286)
  1.      * @final since version 3.4
  2.      */
  3.     protected function render($view, array $parameters = [], Response $response null)
  4.     {
  5.         if ($this->container->has('templating')) {
  6.             $content $this->container->get('templating')->render($view$parameters);
  7.         } elseif ($this->container->has('twig')) {
  8.             $content $this->container->get('twig')->render($view$parameters);
  9.         } else {
  10.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  11.         }
Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) in src/CatalogBundle/Controller/DefaultController.php (line 111)
  1.         if($product->isDeleted()) return ($category instanceOf Category && !$category->isDeleted()) ? $this->redirectToRoute('product_list', ['id'=>$category->isDeleted(), 'slug'=>$category->translate()->getSlug()]) : $this->redirectToRoute('homepage');
  2.     
  3.         $attributes_all $this->getAttributes($request$product);
  4.         $attributes $attributes_all[0];
  5.         $attributes_items $attributes_all[1];
  6.         return $this->render('app/catalog/show.html.twig', ['category' => $category'product' => $product"attributes" => $attributes"attributes_items" => $attributes_items,]);
  7.     }
  8.     
  9.     private function getAttributes($request$entity)
  10.     {
  11.         /** @var Product $product */
DefaultController->showAction(object(Request), object(Category), object(Product)) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  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) {
HttpKernel->handle(object(Request), 1, true) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)
  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(object(Request)) in web/app.php (line 23)
  1. $request Request::createFromGlobals();
  2. Request::setTrustedProxies(
  3.     ['192.0.0.1''10.0.0.0/8'],
  4.     Request::HEADER_X_FORWARDED_ALL
  5. );
  6. $response $kernel->handle($request);
  7. $response->send();
  8. $kernel->terminate($request$response);

Twig\Error\ LoaderError

Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form).

  1.         if (!$throw) {
  2.             return false;
  3.         }
  4.         throw new LoaderError($this->errorCache[$name]);
  5.     }
  6.     private function normalizeName($name)
  7.     {
  8.         return preg_replace('#/{2,}#''/'str_replace('\\''/'$name));
FilesystemLoader->findTemplate('app/catalog/show.html.twig') in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php (line 76)
  1.             return $this->cache[$logicalName];
  2.         }
  3.         $file null;
  4.         try {
  5.             $file parent::findTemplate($logicalName);
  6.         } catch (LoaderError $e) {
  7.             $twigLoaderException $e;
  8.             // for BC
  9.             try {
FilesystemLoader->findTemplate('app/catalog/show.html.twig') in vendor/twig/twig/src/Loader/FilesystemLoader.php (line 150)
  1.         return new Source(file_get_contents($path), $name$path);
  2.     }
  3.     public function getCacheKey($name)
  4.     {
  5.         if (null === ($path $this->findTemplate($name)) || false === $path) {
  6.             return '';
  7.         }
  8.         $len = \strlen($this->rootPath);
  9.         if (=== strncmp($this->rootPath$path$len)) {
  10.             return substr($path$len);
FilesystemLoader->getCacheKey('app/catalog/show.html.twig') in vendor/twig/twig/src/Environment.php (line 299)
  1.      *
  2.      * @internal
  3.      */
  4.     public function getTemplateClass($name$index null)
  5.     {
  6.         $key $this->getLoader()->getCacheKey($name).$this->optionsHash;
  7.         return $this->templateClassPrefix.hash('sha256'$key).(null === $index '' '___'.$index);
  8.     }
  9.     /**
Environment->getTemplateClass('app/catalog/show.html.twig') in vendor/twig/twig/src/Environment.php (line 381)
  1.      *
  2.      * @internal
  3.      */
  4.     public function loadTemplate($name$index null)
  5.     {
  6.         return $this->loadClass($this->getTemplateClass($name), $name$index);
  7.     }
  8.     /**
  9.      * @internal
  10.      */
Environment->loadTemplate('app/catalog/show.html.twig') in vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php (line 131)
  1.         if ($name instanceof Template) {
  2.             return $name;
  3.         }
  4.         try {
  5.             return $this->environment->loadTemplate((string) $name);
  6.         } catch (LoaderError $e) {
  7.             throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
  8.         }
  9.     }
  10. }
TwigEngine->load('app/catalog/show.html.twig') in vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php (line 50)
  1.      *
  2.      * @throws Error if something went wrong like a thrown exception while rendering the template
  3.      */
  4.     public function render($name, array $parameters = [])
  5.     {
  6.         return $this->load($name)->render($parameters);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      *
TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php (line 286)
  1.      * @final since version 3.4
  2.      */
  3.     protected function render($view, array $parameters = [], Response $response null)
  4.     {
  5.         if ($this->container->has('templating')) {
  6.             $content $this->container->get('templating')->render($view$parameters);
  7.         } elseif ($this->container->has('twig')) {
  8.             $content $this->container->get('twig')->render($view$parameters);
  9.         } else {
  10.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  11.         }
Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) in src/CatalogBundle/Controller/DefaultController.php (line 111)
  1.         if($product->isDeleted()) return ($category instanceOf Category && !$category->isDeleted()) ? $this->redirectToRoute('product_list', ['id'=>$category->isDeleted(), 'slug'=>$category->translate()->getSlug()]) : $this->redirectToRoute('homepage');
  2.     
  3.         $attributes_all $this->getAttributes($request$product);
  4.         $attributes $attributes_all[0];
  5.         $attributes_items $attributes_all[1];
  6.         return $this->render('app/catalog/show.html.twig', ['category' => $category'product' => $product"attributes" => $attributes"attributes_items" => $attributes_items,]);
  7.     }
  8.     
  9.     private function getAttributes($request$entity)
  10.     {
  11.         /** @var Product $product */
DefaultController->showAction(object(Request), object(Category), object(Product)) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  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) {
HttpKernel->handle(object(Request), 1, true) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)
  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(object(Request)) in web/app.php (line 23)
  1. $request Request::createFromGlobals();
  2. Request::setTrustedProxies(
  3.     ['192.0.0.1''10.0.0.0/8'],
  4.     Request::HEADER_X_FORWARDED_ALL
  5. );
  6. $response $kernel->handle($request);
  7. $response->send();
  8. $kernel->terminate($request$response);

Logs

No log messages

Stack Traces 2

[2/2] InvalidArgumentException

InvalidArgumentException:
Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form).

  at vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:133
  at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/show.html.twig')
     (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:50)
  at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array()))
     (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:286)
  at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array()))
     (src/CatalogBundle/Controller/DefaultController.php:111)
  at CatalogBundle\Controller\DefaultController->showAction(object(Request), object(Category), object(Product))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app.php:23)

                                

[1/2] LoaderError

Twig\Error\LoaderError:
Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form).

  at vendor/twig/twig/src/Loader/FilesystemLoader.php:250
  at Twig\Loader\FilesystemLoader->findTemplate('app/catalog/show.html.twig')
     (vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php:76)
  at Symfony\Bundle\TwigBundle\Loader\FilesystemLoader->findTemplate('app/catalog/show.html.twig')
     (vendor/twig/twig/src/Loader/FilesystemLoader.php:150)
  at Twig\Loader\FilesystemLoader->getCacheKey('app/catalog/show.html.twig')
     (vendor/twig/twig/src/Environment.php:299)
  at Twig\Environment->getTemplateClass('app/catalog/show.html.twig')
     (vendor/twig/twig/src/Environment.php:381)
  at Twig\Environment->loadTemplate('app/catalog/show.html.twig')
     (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:131)
  at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/show.html.twig')
     (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:50)
  at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array()))
     (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:286)
  at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array()))
     (src/CatalogBundle/Controller/DefaultController.php:111)
  at CatalogBundle\Controller\DefaultController->showAction(object(Request), object(Category), object(Product))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app.php:23)