Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13)

Exception

ErrorException

  1.      * @return int|false
  2.      */
  3.     #[\ReturnTypeWillChange]
  4.     public function gc($maxlifetime)
  5.     {
  6.         return $this->handler->gc($maxlifetime);
  7.     }
  8. }
  1.      * @return int|false
  2.      */
  3.     #[\ReturnTypeWillChange]
  4.     public function gc($maxlifetime)
  5.     {
  6.         return $this->handler->gc($maxlifetime);
  7.     }
  8.     /**
  9.      * @return bool
  10.      */
SessionHandlerProxy->gc()
  1.             // the session ID in the header is invalid, create a new one
  2.             session_id(session_create_id());
  3.         }
  4.         // ok to try and start the session
  5.         if (!session_start()) {
  6.             throw new \RuntimeException('Failed to start the session.');
  7.         }
  8.         if (null !== $this->emulateSameSite) {
  9.             $originalCookie SessionUtils::popSessionCookie(session_name(), session_id());
  1.         }
  2.         if (!$this->started && $this->saveHandler->isActive()) {
  3.             $this->loadSession();
  4.         } elseif (!$this->started) {
  5.             $this->start();
  6.         }
  7.         return $this->bags[$name];
  8.     }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function getBag(string $name)
  5.     {
  6.         $bag $this->storage->getBag($name);
  7.         return method_exists($bag'getBag') ? $bag->getBag() : $bag;
  8.     }
  9.     /**
  1.      *
  2.      * Note that this method was added to help with IDE autocompletion.
  3.      */
  4.     private function getAttributeBag(): AttributeBagInterface
  5.     {
  6.         return $this->getBag($this->attributeName);
  7.     }
  8. }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function get(string $name$default null)
  5.     {
  6.         return $this->getAttributeBag()->get($name$default);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  1.         }
  2.         $routeData = ['name' => $routeName'params' => array_merge($routeParams$routeQueries)];
  3.         // Do not save same matched route twice
  4.         $lastRoute $session->get('last_route', []);
  5.         $thisRoute $session->get('this_route', []);
  6.         if (!empty($lastRoute) && !empty($thisRoute) && $lastRoute === $thisRoute) {
  7.             return;
  8.         }
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  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.     private function handleRaw(Request $requestint $type self::MAIN_REQUEST): Response
  3.     {
  4.         // request
  5.         $event = new RequestEvent($this$request$type);
  6.         $this->dispatcher->dispatch($eventKernelEvents::REQUEST);
  7.         if ($event->hasResponse()) {
  8.             return $this->filterResponse($event->getResponse(), $request$type);
  9.         }
  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 (\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() in web/app_staging.php (line 15)
  1. $kernel = new AppKernel('staging'true);
  2. $request Request::createFromGlobals();
  3. $response $kernel->handle($request);
  4. $response->send();
  5. $kernel->terminate($request$response);
include_once('/srv/mooc-v2/staging/web/app_staging.php') in web/app.php (line 43)
  1. switch (getenv('APPLICATION_ENV')) {
  2.     case 'dev':
  3.         include_once 'app_dev.php';
  4.         break;
  5.     case 'staging':
  6.         include_once 'app_staging.php';
  7.         break;
  8.     case 'preprod':
  9.         include_once 'app_preprod.php';
  10.         break;
  11.     default:

Logs

No log messages

Stack Trace

ErrorException
ErrorException:
Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13)

  at vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php:116
  at Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler->gc()
     (vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php:91)
  at Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->gc()
  at session_start()
     (vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:185)
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
     (vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:352)
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag()
     (vendor/symfony/http-foundation/Session/Session.php:261)
  at Symfony\Component\HttpFoundation\Session\Session->getBag()
     (vendor/symfony/http-foundation/Session/Session.php:283)
  at Symfony\Component\HttpFoundation\Session\Session->getAttributeBag()
     (vendor/symfony/http-foundation/Session/Session.php:77)
  at Symfony\Component\HttpFoundation\Session\Session->get()
     (src/Mooc/MoocBundle/EventListener/LastRouteListener.php:30)
  at Mooc\MoocBundle\EventListener\LastRouteListener->onKernelRequest()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:139)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web/app_staging.php:15)
  at include_once('/srv/mooc-v2/staging/web/app_staging.php')
     (web/app.php:43)