Error 500 Internal Server Error

GET https://otoline.fr/connect/google

Exceptions

Environment variable not found: "OAUTH_GOOGLE_CLIENT_ID".

Exception

Symfony\Component\DependencyInjection\Exception\ EnvNotFoundException

  1. }
  2. }
  3. if (false === $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. $prefix = '';
  2. }
  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/league/oauth2-client/src/Provider/AbstractProvider.php';
  2. include_once \dirname(__DIR__, 4).'/vendor/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php';
  3. include_once \dirname(__DIR__, 4).'/vendor/league/oauth2-google/src/Provider/Google.php';
  4. include_once \dirname(__DIR__, 4).'/vendor/knpuniversity/oauth2-client-bundle/src/DependencyInjection/ProviderFactory.php';
  5. return $container->services['knpu.oauth2.client.google'] = new \KnpU\OAuth2ClientBundle\Client\Provider\GoogleClient((new \KnpU\OAuth2ClientBundle\DependencyInjection\ProviderFactory(($container->services['router'] ?? self::getRouterService($container))))->createProvider('League\\OAuth2\\Client\\Provider\\Google', ['clientId' => $container->getEnv('OAUTH_GOOGLE_CLIENT_ID'), 'clientSecret' => $container->getEnv('OAUTH_GOOGLE_CLIENT_SECRET')], 'connect_google_check', [], []), ($container->services['request_stack'] ??= new \Symfony\Component\HttpFoundation\RequestStack()));
  6. }
  7. }
  1. $file .= '.php';
  2. }
  3. $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4. return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service;
  5. }
  6. protected function createProxy($class, \Closure $factory)
  7. {
  8. class_exists($class, false) || require __DIR__.'/'.$class.'.php';
  1. $container->loading[$id] = true;
  2. try {
  3. if (isset($container->fileMap[$id])) {
  4. return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $container->load($container->fileMap[$id]);
  5. } elseif (isset($container->methodMap[$id])) {
  6. return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $container->{$container->methodMap[$id]}($container);
  7. }
  8. } catch (\Exception $e) {
  9. unset($container->services[$id]);
  1. */
  2. public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
  3. {
  4. return $this->services[$id]
  5. ?? $this->services[$id = $this->aliases[$id] ?? $id]
  6. ?? ('service_container' === $id ? $this : ($this->factories[$id] ?? self::$make ??= self::make(...))($this, $id, $invalidBehavior));
  7. }
  8. /**
  9. * Creates a service.
  10. *
  1. * @throws InvalidOAuth2ClientException
  2. */
  3. public function getClient($key)
  4. {
  5. if (isset($this->serviceMap[$key])) {
  6. $client = $this->container->get($this->serviceMap[$key]);
  7. if (!$client instanceof OAuth2ClientInterface) {
  8. throw new InvalidOAuth2ClientException(\sprintf('Somehow the "%s" client is not an instance of OAuth2ClientInterface.', $key));
  9. }
  10. return $client;
ClientRegistry->getClient() in src/Controller/SecurityController.php (line 237)
  1. #[Route('/connect/google', name: 'connect_google')]
  2. public function connectAction(ClientRegistry $clientRegistry)
  3. {
  4. //Redirect to google
  5. return $clientRegistry->getClient('google')->redirect([], []);
  6. }
  7. /**
  8. * After going to Google, you're redirected back here
  9. * because this is the "redirect_route" you configured
in vendor/symfony/http-kernel/HttpKernel.php -> connectAction (line 183)
  1. $this->dispatcher->dispatch($event, KernelEvents::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($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
  2. Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3. }
  4. try {
  5. return $kernel->handle($request, $type, $catch);
  6. } finally {
  7. // restore global state
  8. Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
  9. }
  10. }
  1. protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response
  2. {
  3. $this->surrogate?->addSurrogateCapability($request);
  4. // always a "master" request (as the real master request can be in cache)
  5. $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
  6. /*
  7. * Support stale-if-error given on Responses or as a config option.
  8. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9. * Cache-Control directives) that
  1. protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response
  2. {
  3. $this->getKernel()->boot();
  4. $this->getKernel()->getContainer()->set('cache', $this);
  5. return parent::forward($request, $catch, $entry);
  6. }
  7. /**
  8. * Returns an array of options to customize the Cache configuration.
  9. */
  1. // avoid that the backend sends no content
  2. $subRequest->headers->remove('If-Modified-Since');
  3. $subRequest->headers->remove('If-None-Match');
  4. $response = $this->forward($subRequest, $catch);
  5. if ($response->isCacheable()) {
  6. $this->store($request, $response);
  7. }
  1. }
  2. if (null === $entry) {
  3. $this->record($request, 'miss');
  4. return $this->fetch($request, $catch);
  5. }
  6. if (!$this->isFreshEnough($request, $entry)) {
  7. $this->record($request, 'stale');
  1. $response = $this->fetch($request, $catch);
  2. } else {
  3. $response = null;
  4. do {
  5. try {
  6. $response = $this->lookup($request, $catch);
  7. } catch (CacheWasLockedException) {
  8. }
  9. } while (null === $response);
  10. }
  1. if ($container->has('http_cache')) {
  2. $this->handlingHttpCache = true;
  3. try {
  4. return $container->get('http_cache')->handle($request, $type, $catch);
  5. } finally {
  6. $this->handlingHttpCache = false;
  7. $this->resetServices = true;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/home/u981082908/domains/otoline.fr/public_html/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. return function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Message
info 07:37:32 User Deprecated: Class "Doctrine\ORM\Proxy\Autoloader" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm)
{
    "exception": {}
}
info 07:37:32 Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "9e78ab"
    },
    "request_uri": "https://otoline.fr/_profiler/9e78ab?panel=exception&type=request",
    "method": "GET"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Nelmio\CorsBundle\EventListener\CorsListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Nelmio\\CorsBundle\\EventListener\\CorsListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bridge\\Doctrine\\Middleware\\IdleConnection\\Listener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\SessionListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::setDefaultLocale".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::setDefaultLocale"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleAwareListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleAwareListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::configureLogoutUrlGenerator".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::configureLogoutUrlGenerator"
}
debug 07:37:32 Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::onKernelRequest"
}
debug 07:37:32 Notified event "kernel.request" to listener "App\EventSubscriber\CheckUserSubscriber::checkIsForfait".
{
    "event": "kernel.request",
    "listener": "App\\EventSubscriber\\CheckUserSubscriber::checkIsForfait"
}
debug 07:37:32 Notified event "kernel.request" to listener "MobileDetectBundle\EventListener\RequestResponseListener::handleRequest".
{
    "event": "kernel.request",
    "listener": "MobileDetectBundle\\EventListener\\RequestResponseListener::handleRequest"
}
debug 07:37:32 Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector::onKernelController"
}
debug 07:37:32 Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector::onKernelController"
}
info 07:37:32 User Deprecated: Support for MySQL < 8 is deprecated and will be removed in DBAL 5 (AbstractMySQLDriver.php:75 called by AbstractDriverMiddleware.php:32, https://github.com/doctrine/dbal/pull/6343, package doctrine/dbal)
{
    "exception": {}
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\IsSignatureValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\IsSignatureValidAttributeListener::onKernelControllerArguments"
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsCsrfTokenValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsCsrfTokenValidAttributeListener::onKernelControllerArguments"
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsGrantedAttributeListener::onKernelControllerArguments"
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\CacheAttributeListener::onKernelControllerArguments"
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver::onKernelControllerArguments"
}
debug 07:37:32 Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener::onControllerArguments"
}

Stack Trace

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

  at vendor/symfony/dependency-injection/EnvVarProcessor.php:221
  at Symfony\Component\DependencyInjection\EnvVarProcessor->getEnv()
     (vendor/symfony/dependency-injection/Container.php:378)
  at Symfony\Component\DependencyInjection\Container->getEnv()
     (var/cache/dev/ContainerMWkVLBs/getKnpu_Oauth2_Client_GoogleService.php:32)
  at ContainerMWkVLBs\getKnpu_Oauth2_Client_GoogleService::do()
     (var/cache/dev/ContainerMWkVLBs/App_KernelDevDebugContainer.php:547)
  at ContainerMWkVLBs\App_KernelDevDebugContainer->load()
     (vendor/symfony/dependency-injection/Container.php:221)
  at Symfony\Component\DependencyInjection\Container::make()
     (vendor/symfony/dependency-injection/Container.php:203)
  at Symfony\Component\DependencyInjection\Container->get()
     (vendor/knpuniversity/oauth2-client-bundle/src/Client/ClientRegistry.php:43)
  at KnpU\OAuth2ClientBundle\Client\ClientRegistry->getClient()
     (src/Controller/SecurityController.php:237)
  at App\Controller\SecurityController->connectAction()
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:466)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:68)
  at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:443)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:341)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:216)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/symfony/http-kernel/Kernel.php:178)
  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:32)
  at require_once('/home/u981082908/domains/otoline.fr/public_html/vendor/autoload_runtime.php')
     (public/index.php:5)