Symfony Exception

LoaderError

HTTP 500 Internal Server Error

Unable to find template "default/formation.html.twig" (looked into: /var/www/vhosts/cpi.lu/httpdocs/templates, /var/www/vhosts/cpi.lu/httpdocs/vendor/symfony/twig-bridge/Resources/views/Form).

Exception

Twig\Error\ LoaderError

  1.         if (!$throw) {
  2.             return null;
  3.         }
  4.         throw new LoaderError($this->errorCache[$name]);
  5.     }
  6.     private function normalizeName(string $name): string
  7.     {
  8.         return preg_replace('#/{2,}#''/'str_replace('\\''/'$name));
  1.         return new Source(file_get_contents($path), $name$path);
  2.     }
  3.     public function getCacheKey(string $name): string
  4.     {
  5.         if (null === $path $this->findTemplate($name)) {
  6.             return '';
  7.         }
  8.         $len \strlen($this->rootPath);
  9.         if (=== strncmp($this->rootPath$path$len)) {
  10.             return substr($path$len);
in vendor/twig/twig/src/Environment.php -> getCacheKey (line 264)
  1.      *
  2.      * @internal
  3.      */
  4.     public function getTemplateClass(string $nameint $index null): string
  5.     {
  6.         $key $this->getLoader()->getCacheKey($name).$this->optionsHash;
  7.         return $this->templateClassPrefix.hash(\PHP_VERSION_ID 80100 'sha256' 'xxh128'$key).(null === $index '' '___'.$index);
  8.     }
  9.     /**
in vendor/twig/twig/src/Environment.php -> getTemplateClass (line 312)
  1.     {
  2.         if ($name instanceof TemplateWrapper) {
  3.             return $name;
  4.         }
  5.         return new TemplateWrapper($this$this->loadTemplate($this->getTemplateClass($name), $name));
  6.     }
  7.     /**
  8.      * Loads a template internal representation.
  9.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = []): string
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.         if (!$this->container->has('twig')) {
  3.             throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      */
  1.     /**
  2.      * Renders a view.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         if (null === $response) {
  8.             $response = new Response();
  9.         }
AbstractController->render() in src/Controller/DefaultController.php (line 170)
  1.     /**
  2.         * @Route("/{locale}/formation", name="app_formation")
  3.     */
  4.     public function formation($locale): Response
  5.     {
  6.         return $this->render('default/formation.html.twig', [
  7.             'controller_name' => 'DefaultController',
  8.         ]);
  9.     }
  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.         $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 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/var/www/vhosts/cpi.lu/httpdocs/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. if($_SERVER['REMOTE_ADDR'] == '90.63.222.84')
  5. {
  6.     return function (array $context) {
  7.         return new Kernel($context['APP_DEV'], (bool) $context['APP_DEBUG']);
  8.     };

Logs

No log messages

Stack Trace

LoaderError
Twig\Error\LoaderError:
Unable to find template "default/formation.html.twig" (looked into: /var/www/vhosts/cpi.lu/httpdocs/templates, /var/www/vhosts/cpi.lu/httpdocs/vendor/symfony/twig-bridge/Resources/views/Form).

  at vendor/twig/twig/src/Loader/FilesystemLoader.php:227
  at Twig\Loader\FilesystemLoader->findTemplate()
     (vendor/twig/twig/src/Loader/FilesystemLoader.php:131)
  at Twig\Loader\FilesystemLoader->getCacheKey()
     (vendor/twig/twig/src/Environment.php:264)
  at Twig\Environment->getTemplateClass()
     (vendor/twig/twig/src/Environment.php:312)
  at Twig\Environment->load()
     (vendor/twig/twig/src/Environment.php:280)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:258)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:266)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/DefaultController.php:170)
  at App\Controller\DefaultController->formation()
     (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/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/var/www/vhosts/cpi.lu/httpdocs/vendor/autoload_runtime.php')
     (public/index.php:5)