Symfony Exception

EntityNotFoundException RuntimeError

HTTP 500 Internal Server Error

An exception has been thrown during the rendering of a template ("Entity of type 'App\Entity\Poblaciones' for IDs id(0) was not found").

Exceptions 2

Twig\Error\ RuntimeError

  1.             <div class="col-md-8 order-2 order-md-1 align-self-center p-static">
  2.                 <h1 data-title-border>{{ hostal.nombre }}</h1>
  3.                 <ul class="breadcrumb">
  4.                     <li><a href="{{ path('homepage') }}">{{ 'Home'|trans }}</a></li>
  5.                     <li><a href="{{ path('camino_index') }}">Caminos de Santiago</a></li>
  6.                     <li><a class="active" href="{{ path('poblaciones_show', {'slug': hostal.poblacion.codigoseo}) }}">{{ hostal.poblacion.nombre}}</a></li>
  7.                 </ul>
  8.             </div>
  9.             <div class="col-md-4 order-1 order-md-2 align-self-center">
  10.                  <a class="btn btn-sm mt-4 btn-tertiary" href="{{ path('poblaciones_show', {'slug': hostal.poblacion.codigoseo}) }}">¿Quieres ver otros hospedajes en el municipio?</a>
  11.             </div>
  1. </head>
  2. <body>
  3. ";
  4.         // line 67
  5.         $this->displayBlock('body'$context$blocks);
  6.         // line 68
  7.         echo "
  8. <!-- Vendor -->
  9. <script src=\"";
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.         $macros $this->macros;
  2.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  3.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""hostales/show.html.twig"));
  4.         $this->parent $this->loadTemplate("base.html.twig""hostales/show.html.twig"1);
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  8.     }
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
in vendor/twig/twig/src/Template.php -> display (line 379)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.     public function render(array $context = []): string
  2.     {
  3.         // using func_get_args() allows to not expose the blocks argument
  4.         // as it should only be used by internal code
  5.         return $this->template->render($context\func_get_args()[1] ?? []);
  6.     }
  7.     public function display(array $context = [])
  8.     {
  9.         // using func_get_args() allows to not expose the blocks argument
  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.             if ($v instanceof FormInterface) {
  2.                 $parameters[$k] = $v->createView();
  3.             }
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      *
  1.      * If an invalid form is found in the list of parameters, a 422 status code is returned.
  2.      * Forms found in parameters are auto-cast to form views.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         $response ??= new Response();
  8.         if (200 === $response->getStatusCode()) {
  9.             foreach ($parameters as $v) {
  10.                 if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) {
AbstractController->render() in src/Controller/HostalesController.php (line 43)
  1.         //$statement->bindValue('id', 123);
  2.     
  3.         $imagenes $statement->fetchAll();
  4.         return $this->render('hostales/show.html.twig', [
  5.             'hostal' => $hostal,
  6.             'dormitorios' => $dormitorios,
  7.             'imagenes' => $imagenes
  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$event);
  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 (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  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 25)
  1.     Request::setTrustedHosts([$trustedHosts]);
  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);

Doctrine\ORM\ EntityNotFoundException

Entity of type 'App\Entity\Poblaciones' for IDs id(0) was not found

  1.         foreach ($id as $key => $value) {
  2.             $ids[] = $key '(' $value ')';
  3.         }
  4.         return new self(
  5.             'Entity of type \'' $className '\'' . ($ids ' for IDs ' implode(', '$ids) : '') . ' was not found'
  6.         );
  7.     }
  8.     /**
in vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php :: fromClassNameAndIdentifier (line 234)
  1.         return function (Proxy $proxy) use ($entityPersister$classMetadata): void {
  2.             $identifier $classMetadata->getIdentifierValues($proxy);
  3.             $entity     $entityPersister->loadById($identifier$proxy->__isCloning null $proxy);
  4.             if ($entity === null) {
  5.                 throw EntityNotFoundException::fromClassNameAndIdentifier(
  6.                     $classMetadata->getName(),
  7.                     $this->identifierFlattener->flattenIdentifier($classMetadata$identifier)
  8.                 );
  9.             }
in vendor/symfony/var-exporter/Internal/LazyObjectState.php -> Doctrine\ORM\Proxy\{closure} (line 95)
  1.         try {
  2.             if ($defaultProperties array_diff_key(LazyObjectRegistry::$defaultProperties[$instance::class], $this->skippedProperties)) {
  3.                 PublicHydrator::hydrate($instance$defaultProperties);
  4.             }
  5.             ($this->initializer)($instance);
  6.         } catch (\Throwable $e) {
  7.             $this->status self::STATUS_UNINITIALIZED_FULL;
  8.             $this->reset($instance);
  9.             throw $e;
  1.         if ([$class, , $readonlyScope] = $propertyScopes[$name] ?? null) {
  2.             $scope Registry::getScope($propertyScopes$class$name);
  3.             $state $this->lazyObjectState ?? null;
  4.             if ($state && (null === $scope || isset($propertyScopes["\0$scope\0$name"]))
  5.                 && LazyObjectState::STATUS_UNINITIALIZED_PARTIAL !== $state->initialize($this$name$readonlyScope ?? $scope)
  6.             ) {
  7.                 goto get_in_scope;
  8.             }
  9.         }
Poblaciones->__get() in src/Entity/Poblaciones.php (line 447)
  1.         return $this;
  2.     }
  3.     public function getCodigoseo(): ?string
  4.     {
  5.         return $this->codigoseo;
  6.     }
  7.     public function setCodigoseo(string $codigoseo): self
  8.     {
  9.         $this->codigoseo $codigoseo;
  1.     }
  2.     // Some objects throw exceptions when they have __call, and the method we try
  3.     // to call is not supported. If ignoreStrictCheck is true, we should return null.
  4.     try {
  5.         $ret $object->$method(...$arguments);
  6.     } catch (\BadMethodCallException $e) {
  7.         if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
  8.             return;
  9.         }
  10.         throw $e;
  1.         // line 14
  2.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("camino_index");
  3.         echo "\">Caminos de Santiago</a></li>
  4.                     <li><a class=\"active\" href=\"";
  5.         // line 15
  6.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("poblaciones_show", ["slug" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["hostal"]) || array_key_exists("hostal"$context) ? $context["hostal"] : (function () { throw new RuntimeError('Variable "hostal" does not exist.'15$this->source); })()), "poblacion", [], "any"falsefalsefalse15), "codigoseo", [], "any"falsefalsefalse15)]), "html"nulltrue);
  7.         echo "\">";
  8.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["hostal"]) || array_key_exists("hostal"$context) ? $context["hostal"] : (function () { throw new RuntimeError('Variable "hostal" does not exist.'15$this->source); })()), "poblacion", [], "any"falsefalsefalse15), "nombre", [], "any"falsefalsefalse15), "html"nulltrue);
  9.         echo "</a></li>
  10.                 </ul>
  11.             </div>
in vendor/twig/twig/src/Template.php -> block_body (line 171)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1. </head>
  2. <body>
  3. ";
  4.         // line 67
  5.         $this->displayBlock('body'$context$blocks);
  6.         // line 68
  7.         echo "
  8. <!-- Vendor -->
  9. <script src=\"";
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.         $macros $this->macros;
  2.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  3.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""hostales/show.html.twig"));
  4.         $this->parent $this->loadTemplate("base.html.twig""hostales/show.html.twig"1);
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  8.     }
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
in vendor/twig/twig/src/Template.php -> display (line 379)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.     public function render(array $context = []): string
  2.     {
  3.         // using func_get_args() allows to not expose the blocks argument
  4.         // as it should only be used by internal code
  5.         return $this->template->render($context\func_get_args()[1] ?? []);
  6.     }
  7.     public function display(array $context = [])
  8.     {
  9.         // using func_get_args() allows to not expose the blocks argument
  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.             if ($v instanceof FormInterface) {
  2.                 $parameters[$k] = $v->createView();
  3.             }
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      *
  1.      * If an invalid form is found in the list of parameters, a 422 status code is returned.
  2.      * Forms found in parameters are auto-cast to form views.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         $response ??= new Response();
  8.         if (200 === $response->getStatusCode()) {
  9.             foreach ($parameters as $v) {
  10.                 if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) {
AbstractController->render() in src/Controller/HostalesController.php (line 43)
  1.         //$statement->bindValue('id', 123);
  2.     
  3.         $imagenes $statement->fetchAll();
  4.         return $this->render('hostales/show.html.twig', [
  5.             'hostal' => $hostal,
  6.             'dormitorios' => $dormitorios,
  7.             'imagenes' => $imagenes
  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$event);
  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 (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  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 25)
  1.     Request::setTrustedHosts([$trustedHosts]);
  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);

Logs

No log messages

Stack Traces 2

[2/2] RuntimeError
Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Entity of type 'App\Entity\Poblaciones' for IDs id(0) was not found").

  at templates/hostales/show.html.twig:15
  at Twig\Template->displayBlock()
     (var/cache/dev/twig/14/146691ef3ace31af3131f1efcb5c2b67.php:176)
  at __TwigTemplate_e6f8b7bda70f5cbc4e71af684a9727a6->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/dev/twig/41/41c3277cf5d2da0a93add7099f40f049.php:46)
  at __TwigTemplate_335ae9ab90c2eaef39770a963a247a92->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:280)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:242)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:253)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/HostalesController.php:43)
  at App\Controller\HostalesController->show()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:184)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:25)                
[1/2] EntityNotFoundException
Doctrine\ORM\EntityNotFoundException:
Entity of type 'App\Entity\Poblaciones' for IDs id(0) was not found

  at vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php:33
  at Doctrine\ORM\EntityNotFoundException::fromClassNameAndIdentifier()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php:234)
  at Doctrine\ORM\Proxy\ProxyFactory->Doctrine\ORM\Proxy\{closure}()
     (vendor/symfony/var-exporter/Internal/LazyObjectState.php:95)
  at Symfony\Component\VarExporter\Internal\LazyObjectState->initialize()
     (vendor/symfony/var-exporter/LazyGhostTrait.php:175)
  at Proxies\__CG__\App\Entity\Poblaciones->__get()
     (src/Entity/Poblaciones.php:447)
  at App\Entity\Poblaciones->getCodigoseo()
     (vendor/twig/twig/src/Extension/CoreExtension.php:1635)
  at twig_get_attribute()
     (var/cache/dev/twig/41/41c3277cf5d2da0a93add7099f40f049.php:101)
  at __TwigTemplate_335ae9ab90c2eaef39770a963a247a92->block_body()
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock()
     (var/cache/dev/twig/14/146691ef3ace31af3131f1efcb5c2b67.php:176)
  at __TwigTemplate_e6f8b7bda70f5cbc4e71af684a9727a6->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/dev/twig/41/41c3277cf5d2da0a93add7099f40f049.php:46)
  at __TwigTemplate_335ae9ab90c2eaef39770a963a247a92->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:280)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:242)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:253)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/HostalesController.php:43)
  at App\Controller\HostalesController->show()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:184)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:25)