Environment variable not found: "MAILER_URL". (500 Internal Server Error)

Symfony Exception

EnvNotFoundException

HTTP 500 Internal Server Error

Environment variable not found: "MAILER_URL".

Exception

Symfony\Component\DependencyInjection\Exception\ EnvNotFoundException

  1.             $env $_ENV[$name];
  2.         } elseif (isset($_SERVER[$name]) && !== strpos($name'HTTP_')) {
  3.             $env $_SERVER[$name];
  4.         } elseif (false === ($env getenv($name)) || null === $env) { // null is a possible value because of thread safety issues
  5.             if (!$this->container->hasParameter("env($name)")) {
  6.                 throw new EnvNotFoundException(sprintf('Environment variable not found: "%s".'$name));
  7.             }
  8.             if (null === $env $this->container->getParameter("env($name)")) {
  9.                 return null;
  10.             }
  1.         }
  2.         $processor $processors->has($prefix) ? $processors->get($prefix) : new EnvVarProcessor($this);
  3.         $this->resolving[$envName] = true;
  4.         try {
  5.             return $this->envCache[$name] = $processor->getEnv($prefix$localName$this->getEnv);
  6.         } finally {
  7.             unset($this->resolving[$envName]);
  8.         }
  9.     }
  1. include_once $this->targetDirs[3].'/vendor/symfony/swiftmailer-bundle/DependencyInjection/SwiftmailerTransportFactory.php';
  2. include_once $this->targetDirs[3].'/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php';
  3. include_once $this->targetDirs[3].'/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php';
  4. return $this->services['swiftmailer.mailer.default.transport.real'] = \Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerTransportFactory::createTransport(['transport' => 'smtp''url' => $this->getEnv('MAILER_URL'), 'username' => NULL'password' => NULL'host' => 'localhost''port' => NULL'timeout' => 30'source_ip' => NULL'local_domain' => NULL'encryption' => NULL'auth_mode' => NULL'command' => '/usr/sbin/sendmail -bs'], ($this->privates['router.request_context'] ?? $this->getRouter_RequestContextService()), ($this->privates['swiftmailer.mailer.default.transport.eventdispatcher'] ?? ($this->privates['swiftmailer.mailer.default.transport.eventdispatcher'] = new \Swift_Events_SimpleEventDispatcher())));
  1.         return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php';
  2.     }
  3.     protected function load($file$lazyLoad true)
  4.     {
  5.         return require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  6.     }
  7.     /**
  8.      * Gets the public 'craue_formflow_util' shared service.
  9.      *
  1.         $this->loading[$id] = true;
  2.         try {
  3.             if (isset($this->fileMap[$id])) {
  4.                 return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ === $invalidBehavior null $this->load($this->fileMap[$id]);
  5.             } elseif (isset($this->methodMap[$id])) {
  6.                 return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ === $invalidBehavior null $this->{$this->methodMap[$id]}();
  7.             }
  8.         } catch (\Exception $e) {
  9.             unset($this->services[$id]);
  1.      */
  2.     public function get($id$invalidBehavior /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
  3.     {
  4.         return $this->services[$id]
  5.             ?? $this->services[$id $this->aliases[$id] ?? $id]
  6.             ?? ('service_container' === $id $this : ($this->factories[$id] ?? [$this'make'])($id$invalidBehavior));
  7.     }
  8.     /**
  9.      * Creates a service.
  10.      *
  1.                     $transport $mailer->getTransport();
  2.                     if ($transport instanceof \Swift_Transport_SpoolTransport) {
  3.                         $spool $transport->getSpool();
  4.                         if ($spool instanceof \Swift_MemorySpool) {
  5.                             try {
  6.                                 $spool->flushQueue($this->container->get(sprintf('swiftmailer.mailer.%s.transport.real'$name)));
  7.                             } catch (\Swift_TransportException $exception) {
  8.                                 if (null !== $this->logger) {
  9.                                     $this->logger->error(sprintf('Exception occurred while flushing email queue: %s'$exception->getMessage()));
  10.                                 }
  11.                             }
  1.         $this->called true;
  2.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  3.         $e $this->stopwatch->start($this->name'event_listener');
  4.         ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         if ($e->isStarted()) {
  6.             $e->stop();
  7.         }
  1.     {
  2.         foreach ($listeners as $listener) {
  3.             if ($event->isPropagationStopped()) {
  4.                 break;
  5.             }
  6.             $listener($event$eventName$this);
  7.         }
  8.     }
  9.     /**
  10.      * Sorts the internal list of listeners for the given event by priority.
  1.      * @param object     $event     The event object to pass to the event handlers/listeners
  2.      */
  3.     protected function callListeners(iterable $listenersstring $eventName$event)
  4.     {
  5.         if ($event instanceof Event) {
  6.             $this->doDispatch($listeners$eventName$event);
  7.             return;
  8.         }
  9.         $stoppable $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function terminate(Request $requestResponse $response)
  5.     {
  6.         $this->dispatcher->dispatch(new TerminateEvent($this$request$response), KernelEvents::TERMINATE);
  7.     }
  8.     /**
  9.      * @internal
  10.      */
in vendor/symfony/http-kernel/Kernel.php->terminate (line 163)
  1.         if (false === $this->booted) {
  2.             return;
  3.         }
  4.         if ($this->getHttpKernel() instanceof TerminableInterface) {
  5.             $this->getHttpKernel()->terminate($request$response);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritdoc}
Kernel->terminate(object(Request), object(Response)) in public/index.php (line 27)
  1. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  2. $request Request::createFromGlobals();
  3. $response $kernel->handle($request);
  4. $response->send();
  5. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

EnvNotFoundException

Symfony\Component\DependencyInjection\Exception\EnvNotFoundException:
Environment variable not found: "MAILER_URL".

  at vendor/symfony/dependency-injection/EnvVarProcessor.php:131
  at Symfony\Component\DependencyInjection\EnvVarProcessor->getEnv('string', 'MAILER_URL', object(Closure))
     (vendor/symfony/dependency-injection/Container.php:412)
  at Symfony\Component\DependencyInjection\Container->getEnv('MAILER_URL')
     (var/cache/Prod/ContainerKKF653P/getSwiftmailer_Mailer_Default_Transport_RealService.php:13)
  at require('/var/www/clients/client1/web61/web/var/cache/Prod/ContainerKKF653P/getSwiftmailer_Mailer_Default_Transport_RealService.php')
     (var/cache/Prod/ContainerKKF653P/srcApp_KernelProdDebugContainer.php:313)
  at ContainerKKF653P\srcApp_KernelProdDebugContainer->load('getSwiftmailer_Mailer_Default_Transport_RealService.php')
     (vendor/symfony/dependency-injection/Container.php:243)
  at Symfony\Component\DependencyInjection\Container->make('swiftmailer.mailer.default.transport.real', 1)
     (vendor/symfony/dependency-injection/Container.php:225)
  at Symfony\Component\DependencyInjection\Container->get('swiftmailer.mailer.default.transport.real')
     (vendor/symfony/swiftmailer-bundle/EventListener/EmailSenderListener.php:61)
  at Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener->onTerminate(object(TerminateEvent), 'kernel.terminate', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:126)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(TerminateEvent), 'kernel.terminate', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:260)
  at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener)), 'kernel.terminate', object(TerminateEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:235)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener)), 'kernel.terminate', object(TerminateEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:73)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(TerminateEvent), 'kernel.terminate')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:168)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(TerminateEvent), 'kernel.terminate')
     (vendor/symfony/http-kernel/HttpKernel.php:88)
  at Symfony\Component\HttpKernel\HttpKernel->terminate(object(Request), object(Response))
     (vendor/symfony/http-kernel/Kernel.php:163)
  at Symfony\Component\HttpKernel\Kernel->terminate(object(Request), object(Response))
     (public/index.php:27)