Symfony Exception

EnvNotFoundException

HTTP 500 Internal Server Error

Environment variable not found: "GOOGLE_ID".

Exception

Symfony\Component\DependencyInjection\Exception\ EnvNotFoundException

  1.                 }
  2.             }
  3.             if (false === $env || null === $env) {
  4.                 if (!$this->container->hasParameter("env($name)")) {
  5.                     throw new EnvNotFoundException(sprintf('Environment variable not found: "%s".'$name));
  6.                 }
  7.                 $env $this->container->getParameter("env($name)");
  8.             }
  9.         }
  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 \dirname(__DIR__4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwnerInterface.php';
  2.         include_once \dirname(__DIR__4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/AbstractResourceOwner.php';
  3.         include_once \dirname(__DIR__4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php';
  4.         include_once \dirname(__DIR__4).'/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/GoogleResourceOwner.php';
  5.         return $container->services['hwi_oauth.resource_owner.google'] = new \HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GoogleResourceOwner(($container->privates['hwi_oauth.http_client'] ?? $container->load('getHwiOauth_HttpClientService')), ($container->privates['security.http_utils'] ?? $container->load('getSecurity_HttpUtilsService')), ['client_id' => $container->getEnv('GOOGLE_ID'), 'client_secret' => $container->getEnv('GOOGLE_SECRET'), 'scope' => 'https://www.googleapis.com/auth/userinfo.profile''paths' => ['email' => 'email''profilepicture' => 'picture'], 'options' => ['access_type' => 'offline']], 'google', ($container->privates['hwi_oauth.storage.session'] ?? $container->load('getHwiOauth_Storage_SessionService')));
  6.     }
  7. }
  1.             $file .= '.php';
  2.         }
  3.         $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4.         return class_exists($classfalse) ? $class::do($this$lazyLoad) : $service;
  5.     }
  6.     /**
  7.      * Gets the public 'event_dispatcher' shared service.
  8.      *
  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($idint $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.         if (!$this->hasResourceOwnerByName($name)) {
  2.             return null;
  3.         }
  4.         /** @var ResourceOwnerInterface $resourceOwner */
  5.         $resourceOwner $this->container->get('hwi_oauth.resource_owner.'.$name);
  6.         return $resourceOwner;
  7.     }
  8.     /**
in vendor/hwi/oauth-bundle/Security/OAuthUtils.php -> getResourceOwnerByName (line 274)
  1.      * @throws \RuntimeException
  2.      */
  3.     protected function getResourceOwner($name)
  4.     {
  5.         foreach ($this->ownerMaps as $ownerMap) {
  6.             $resourceOwner $ownerMap->getResourceOwnerByName($name);
  7.             if ($resourceOwner instanceof ResourceOwnerInterface) {
  8.                 return $resourceOwner;
  9.             }
  10.         }
in vendor/hwi/oauth-bundle/Security/OAuthUtils.php -> getResourceOwner (line 107)
  1.      *
  2.      * @return string
  3.      */
  4.     public function getAuthorizationUrl(Request $request$name$redirectUrl null, array $extraParameters = [])
  5.     {
  6.         $resourceOwner $this->getResourceOwner($name);
  7.         if (null === $redirectUrl) {
  8.             if (!$this->connect || !$this->authorizationChecker->isGranted($this->grantRule)) {
  9.                 $redirectUrl $this->httpUtils->generateUri($request$this->getResourceOwnerCheckPath($name));
  10.             } else {
  1.      * @return RedirectResponse
  2.      */
  3.     public function redirectToServiceAction(Request $request$service): RedirectResponse
  4.     {
  5.         try {
  6.             $authorizationUrl $this->oauthUtils->getAuthorizationUrl($request$service);
  7.         } catch (RuntimeException $e) {
  8.             throw new NotFoundHttpException($e->getMessage(), $e);
  9.         }
  10.         $this->storeReturnPath($request$authorizationUrl);
in vendor/symfony/http-kernel/HttpKernel.php -> redirectToServiceAction (line 157)
  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.     public function handle(Request $requestint $type HttpKernelInterface::MASTER_REQUESTbool $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) {
  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 public/index.php (line 20)
  1.     Debug::enable();
  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);

Stack Trace

EnvNotFoundException

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

  at vendor/symfony/dependency-injection/EnvVarProcessor.php:171
  at Symfony\Component\DependencyInjection\EnvVarProcessor->getEnv('string', 'GOOGLE_ID', object(Closure))
     (vendor/symfony/dependency-injection/Container.php:415)
  at Symfony\Component\DependencyInjection\Container->getEnv('GOOGLE_ID')
     (var/cache/dev/Container1RjsLXG/getHwiOauth_ResourceOwner_GoogleService.php:25)
  at Container1RjsLXG\getHwiOauth_ResourceOwner_GoogleService::do(object(App_KernelDevDebugContainer), true)
     (var/cache/dev/Container1RjsLXG/App_KernelDevDebugContainer.php:222)
  at Container1RjsLXG\App_KernelDevDebugContainer->load('getHwiOauth_ResourceOwner_GoogleService.php')
     (vendor/symfony/dependency-injection/Container.php:246)
  at Symfony\Component\DependencyInjection\Container->make('hwi_oauth.resource_owner.google', 1)
     (vendor/symfony/dependency-injection/Container.php:228)
  at Symfony\Component\DependencyInjection\Container->get('hwi_oauth.resource_owner.google')
     (vendor/hwi/oauth-bundle/Security/Http/ResourceOwnerMap.php:89)
  at HWI\Bundle\OAuthBundle\Security\Http\ResourceOwnerMap->getResourceOwnerByName('google')
     (vendor/hwi/oauth-bundle/Security/OAuthUtils.php:274)
  at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getResourceOwner('google')
     (vendor/hwi/oauth-bundle/Security/OAuthUtils.php:107)
  at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getAuthorizationUrl(object(Request), 'google')
     (vendor/hwi/oauth-bundle/Controller/RedirectToServiceController.php:78)
  at HWI\Bundle\OAuthBundle\Controller\RedirectToServiceController->redirectToServiceAction(object(Request), 'google')
     (vendor/symfony/http-kernel/HttpKernel.php:157)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:195)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:20)