if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && headers_sent($file, $line)) { throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); } $sessionId = $_COOKIE[session_name()] ?? null; /* * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. $this->registerBag($flashes); } public function start(): bool { return $this->storage->start(); } public function has(string $name): bool { return $this->getAttributeBag()->has($name); $session = $master->getSession(); if (!$session->isStarted()) { $session->setName('session-'); $session->start(); $session->set('sessionId', $session->getId()); } $salesChannelId = $master->attributes->get(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_ID); if ($salesChannelId === null) { $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } * * @return TEvent */ public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!$event instanceof FlowEventAware) { return $event; } ) { } public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) { return $event; } } $this->dispatch($nested, $name); } } return $this->dispatcher->dispatch($event, $eventName); } /** * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283 */ try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } */ private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response { // request $event = new RequestEvent($this, $request, $type); $this->dispatcher->dispatch($event, KernelEvents::REQUEST); if ($event->hasResponse()) { return $this->filterResponse($event->getResponse(), $request, $type); } $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { if (!KernelFactory::$active) { return parent::handle($request, $type, $catch); } if ($request->attributes->get('exception') !== null) { return parent::handle($request, $type, $catch); } } $request = $this->duplicateRequest($throwable, $event->getRequest()); try { $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { $f = FlattenException::createFromThrowable($e); $this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), basename($e->getFile()), $e->getLine())); $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } * * @return TEvent */ public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!$event instanceof FlowEventAware) { return $event; } ) { } public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) { return $event; } } $this->dispatch($nested, $name); } } return $this->dispatcher->dispatch($event, $eventName); } /** * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283 */ try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { if ($pop = $request !== $this->requestStack->getMainRequest()) { $this->requestStack->push($request); } try { $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST); } finally { if ($pop) { $this->requestStack->pop(); } } if ($hasRun) { throw $e; } $hasRun = true; $kernel->terminateWithException($e, $request); }; } } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $this->exceptionHandler = null; } try { if (null !== $exceptionHandler) { $exceptionHandler($exception); return; } $handlerException ??= $exception; } catch (\Throwable $handlerException) { } try { if (null !== $fatalError) { self::$exitCode = 255; $handler->handleException($fatalError); } } catch (FatalError) { // Ignore this re-throw } 'time' => $profile->getTime(), 'status_code' => $profile->getStatusCode(), 'virtual_type' => $profile->getVirtualType() ?? 'request', ]; $data = serialize($data); if (\function_exists('gzencode')) { $data = gzencode($data, 3); }|
[2/2]
RuntimeException
|
|---|
RuntimeException:
Failed to start the session because headers have already been sent by "/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-foundation/Response.php" at line 408.
at /var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:132
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-foundation/Session/Session.php:59)
at Symfony\Component\HttpFoundation\Session\Session->start()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php:110)
at Shopware\Storefront\Framework\Routing\StorefrontSubscriber->startSession()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/EventDispatcher.php:220)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:47)
at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:70)
at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:31)
at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/HttpKernel.php:157)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Framework/Adapter/Kernel/HttpKernel.php:44)
at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->handle()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/EventListener/ErrorListener.php:117)
at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/EventDispatcher.php:220)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:47)
at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:70)
at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:31)
at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/HttpKernel.php:239)
at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/HttpKernel.php:132)
at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:82)
at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/error-handler/ErrorHandler.php:535)
at Symfony\Component\ErrorHandler\ErrorHandler->handleException()
(/var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/error-handler/ErrorHandler.php:627)
at Symfony\Component\ErrorHandler\ErrorHandler::handleFatalError()
|
|
[1/2]
OutOfMemoryError
|
|---|
Symfony\Component\ErrorHandler\Error\OutOfMemoryError: Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 56627200 bytes) at /var/www/steinstosser.dev.wizmo.cloud/html/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php:171 |