Symfony Exception

RouteNotFoundException

HTTP 500 Internal Server Error

Unable to generate a URL for the named route "travel_form" as such route does not exist.

Exception

Symfony\Component\Routing\Exception\ RouteNotFoundException

  1.                 }
  2.             } while (false !== $locale strstr($locale'_'true));
  3.         }
  4.         if (!isset($this->compiledRoutes[$name])) {
  5.             throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.'$name));
  6.         }
  7.         [$variables$defaults$requirements$tokens$hostTokens$requiredSchemes$deprecations] = $this->compiledRoutes[$name] + [=> []];
  8.         foreach ($deprecations as $deprecation) {
in vendor/symfony/routing/Router.php -> generate (line 209)
  1.         $this->configCacheFactory $configCacheFactory;
  2.     }
  3.     public function generate(string $name, array $parameters = [], int $referenceType self::ABSOLUTE_PATH): string
  4.     {
  5.         return $this->getGenerator()->generate($name$parameters$referenceType);
  6.     }
  7.     public function match(string $pathinfo): array
  8.     {
  9.         return $this->getMatcher()->match($pathinfo);
  1.      *
  2.      * @see UrlGeneratorInterface
  3.      */
  4.     protected function generateUrl(string $route, array $parameters = [], int $referenceType UrlGeneratorInterface::ABSOLUTE_PATH): string
  5.     {
  6.         return $this->container->get('router')->generate($route$parameters$referenceType);
  7.     }
  8.     /**
  9.      * Forwards the request to another controller.
  10.      *
AbstractController->generateUrl() in src/Controller/MainController.php (line 49)
  1.             'fromDate' => (new \DateTime())->modify("+2 days"),
  2.             'toDate' => (new \DateTime())->modify("+3 days")
  3.         ];
  4.         $form $this->createForm(TravelType::class, $data, [
  5.             'action' => $this->generateUrl('travel_form')
  6.         ]);
  7.         return $this->render('main/index.html.twig',[
  8.             'clientFeedbacks' => $provider->getReviews(10),
  9.             'page' => $provider->getHomePageData(),
  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.     }
  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('/var/www/litcarrent/vendor/autoload_runtime.php') in public/index.php (line 7)
  1. umask(0000);
  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. };

Logs

No log messages

Stack Trace

RouteNotFoundException
Symfony\Component\Routing\Exception\RouteNotFoundException:
Unable to generate a URL for the named route "travel_form" as such route does not exist.

  at vendor/symfony/routing/Generator/CompiledUrlGenerator.php:50
  at Symfony\Component\Routing\Generator\CompiledUrlGenerator->generate()
     (vendor/symfony/routing/Router.php:209)
  at Symfony\Component\Routing\Router->generate()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:108)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->generateUrl()
     (src/Controller/MainController.php:49)
  at App\Controller\MainController->index()
     (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()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/var/www/litcarrent/vendor/autoload_runtime.php')
     (public/index.php:7)