Logo
0,00 €

CHRONO PASSION - Novembre/Dicembre 2022 - cartaceo

12,00 €
CHP_4_cartaceo

Anno 2022
Mese 11
Loading…
Loading the web debug toolbar…
Attempt #
Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 381. (500 Internal Server Error)

Symfony Exception

OutOfMemoryError RuntimeException

HTTP 500 Internal Server Error

Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 381.

Exceptions 2

RuntimeException

  1.         if (\PHP_SESSION_ACTIVE === session_status()) {
  2.             throw new \RuntimeException('Failed to start the session: already started by PHP.');
  3.         }
  4.         if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOLEAN) && headers_sent($file$line)) {
  5.             throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.'$file$line));
  6.         }
  7.         $sessionId $_COOKIE[session_name()] ?? null;
  8.         /*
  9.          * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`.
  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 has(string $name)
  5.     {
  6.         return $this->getAttributeBag()->has($name);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  1.     ) {
  2.     }
  3.     public function hasForChannel(ChannelInterface $channel): bool
  4.     {
  5.         return $this->session->has($this->getCartKeyName($channel));
  6.     }
  7.     public function getForChannel(ChannelInterface $channel): ?OrderInterface
  8.     {
  9.         if ($this->hasForChannel($channel)) {
  1.             $channel $this->channelContext->getChannel();
  2.         } catch (ChannelNotFoundException $exception) {
  3.             throw new CartNotFoundException(null$exception);
  4.         }
  5.         if (!$this->cartStorage->hasForChannel($channel)) {
  6.             throw new CartNotFoundException('Sylius was not able to find the cart in session');
  7.         }
  8.         $cart $this->cartStorage->getForChannel($channel);
  9.         if (null === $cart) {
  1.     public function getCart(): OrderInterface
  2.     {
  3.         foreach ($this->cartContexts as $cartContext) {
  4.             try {
  5.                 return $cartContext->getCart();
  6.             } catch (CartNotFoundException) {
  7.                 continue;
  8.             }
  9.         }
  1.     public function collect(Request $requestResponse $response\Throwable $exception null): void
  2.     {
  3.         try {
  4.             /** @var OrderInterface $cart */
  5.             $cart $this->cartContext->getCart();
  6.             $itemsData $cart->getItems()->map(static function (OrderItemInterface $item): array {
  7.                 $variant $item->getVariant();
  8.                 $product $variant->getProduct();
  1.         }
  2.         $response->headers->set('X-Debug-Token'$profile->getToken());
  3.         foreach ($this->collectors as $collector) {
  4.             $collector->collect($request$response$exception);
  5.             // we need to clone for sub-requests
  6.             $profile->addCollector(clone $collector);
  7.         }
  1.             $usageIndexValue $usageIndexReference = &$session->getUsageIndex();
  2.             $usageIndexReference \PHP_INT_MIN;
  3.         }
  4.         try {
  5.             if (!$profile $this->profiler->collect($request$event->getResponse(), $exception)) {
  6.                 return;
  7.             }
  8.         } finally {
  9.             if ($session instanceof Session) {
  10.                 $usageIndexReference $usageIndexValue;
  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 filterResponse(Response $responseRequest $requestint $type): Response
  3.     {
  4.         $event = new ResponseEvent($this$request$type$response);
  5.         $this->dispatcher->dispatch($eventKernelEvents::RESPONSE);
  6.         $this->finishRequest($request$type);
  7.         return $event->getResponse();
  8.     }
  1.                 throw new ControllerDoesNotReturnResponseException($msg$controller__FILE____LINE__ 17);
  2.             }
  3.         }
  4.         return $this->filterResponse($response$request$type);
  5.     }
  6.     /**
  7.      * Filters a response object.
  8.      *
  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.         $throwable $event->getThrowable();
  2.         $request $this->duplicateRequest($throwable$event->getRequest());
  3.         try {
  4.             $response $event->getKernel()->handle($requestHttpKernelInterface::SUB_REQUESTfalse);
  5.         } catch (\Exception $e) {
  6.             $f FlattenException::createFromThrowable($e);
  7.             $this->logException($esprintf('Exception thrown when handling an exception (%s: %s at %s line %s)'$f->getClass(), $f->getMessage(), $e->getFile(), $e->getLine()));
  1.     public function onKernelException(ExceptionEvent $eventstring $eventName nullEventDispatcherInterface $eventDispatcher null): void
  2.     {
  3.         try {
  4.             /** @psalm-suppress TooManyArguments */
  5.             $this->decoratedListener->onKernelException($event$eventName$eventDispatcher);
  6.         } catch (\Throwable $throwable) {
  7.             $this->breakCircularDependency($throwable);
  8.             throw $throwable;
  9.         }
  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.      * @throws \Exception
  2.      */
  3.     private function handleThrowable(\Throwable $eRequest $requestint $type): Response
  4.     {
  5.         $event = new ExceptionEvent($this$request$type$e);
  6.         $this->dispatcher->dispatch($eventKernelEvents::EXCEPTION);
  7.         // a listener might have replaced the exception
  8.         $e $event->getThrowable();
  9.         if (!$event->hasResponse()) {
  1.         if ($pop $request !== $this->requestStack->getMainRequest()) {
  2.             $this->requestStack->push($request);
  3.         }
  4.         try {
  5.             $response $this->handleThrowable($exception$requestself::MAIN_REQUEST);
  6.         } finally {
  7.             if ($pop) {
  8.                 $this->requestStack->pop();
  9.             }
  10.         }
  1.                         if ($hasRun) {
  2.                             throw $e;
  3.                         }
  4.                         $hasRun true;
  5.                         $kernel->terminateWithException($e$request);
  6.                     };
  7.                 }
  8.             } elseif ($event instanceof ConsoleEvent && $app $event->getCommand()->getApplication()) {
  9.                 $output $event->getOutput();
  10.                 if ($output instanceof ConsoleOutputInterface) {
in /var/www/html/vendor/symfony/error-handler/ErrorHandler.php :: Symfony\Component\HttpKernel\EventListener\{closure} (line 607)
  1.             $this->exceptionHandler null;
  2.         }
  3.         try {
  4.             if (null !== $exceptionHandler) {
  5.                 return $exceptionHandler($exception);
  6.             }
  7.             $handlerException $handlerException ?: $exception;
  8.         } catch (\Throwable $handlerException) {
  9.         }
  10.         if ($exception === $handlerException && null === $this->exceptionHandler) {
  1.         }
  2.         try {
  3.             if (null !== $fatalError) {
  4.                 self::$exitCode 255;
  5.                 $handler->handleException($fatalError);
  6.             }
  7.         } catch (FatalError $e) {
  8.             // Ignore this re-throw
  9.         }
ErrorHandler::handleFatalError()

Symfony\Component\ErrorHandler\Error\ OutOfMemoryError

Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2101248 bytes)

  1.             'url' => $profile->getUrl(),
  2.             'time' => $profile->getTime(),
  3.             'status_code' => $profile->getStatusCode(),
  4.         ];
  5.         $data serialize($data);
  6.         if (\function_exists('gzencode')) {
  7.             $data gzencode($data3);
  8.         }

Stack Traces 2

[2/2] RuntimeException
RuntimeException:
Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 381.

  at /var/www/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:145
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
     (/var/www/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:352)
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag()
     (/var/www/html/vendor/symfony/http-foundation/Session/Session.php:261)
  at Symfony\Component\HttpFoundation\Session\Session->getBag()
     (/var/www/html/vendor/symfony/http-foundation/Session/Session.php:283)
  at Symfony\Component\HttpFoundation\Session\Session->getAttributeBag()
     (/var/www/html/vendor/symfony/http-foundation/Session/Session.php:69)
  at Symfony\Component\HttpFoundation\Session\Session->has()
     (/var/www/html/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Storage/CartSessionStorage.php:33)
  at Sylius\Bundle\CoreBundle\Storage\CartSessionStorage->hasForChannel()
     (/var/www/html/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Context/SessionAndChannelBasedCartContext.php:37)
  at Sylius\Bundle\CoreBundle\Context\SessionAndChannelBasedCartContext->getCart()
     (/var/www/html/vendor/sylius/sylius/src/Sylius/Component/Order/Context/CompositeCartContext.php:42)
  at Sylius\Component\Order\Context\CompositeCartContext->getCart()
     (/var/www/html/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Collector/CartCollector.php:83)
  at Sylius\Bundle\CoreBundle\Collector\CartCollector->collect()
     (/var/www/html/vendor/symfony/http-kernel/Profiler/Profiler.php:161)
  at Symfony\Component\HttpKernel\Profiler\Profiler->collect()
     (/var/www/html/vendor/symfony/http-kernel/EventListener/ProfilerListener.php:108)
  at Symfony\Component\HttpKernel\EventListener\ProfilerListener->onKernelResponse()
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:196)
  at Symfony\Component\HttpKernel\HttpKernel->filterResponse()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:184)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (/var/www/html/vendor/symfony/http-kernel/EventListener/ErrorListener.php:91)
  at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException()
     (/var/www/html/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/EventListener/CircularDependencyBreakingErrorListener.php:63)
  at Sylius\Bundle\CoreBundle\EventListener\CircularDependencyBreakingErrorListener->onKernelException()
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (/var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:223)
  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:114)
  at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()
     (/var/www/html/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:131)
  at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}()
     (/var/www/html/vendor/symfony/error-handler/ErrorHandler.php:607)
  at Symfony\Component\ErrorHandler\ErrorHandler->handleException()
     (/var/www/html/vendor/symfony/error-handler/ErrorHandler.php:697)
  at Symfony\Component\ErrorHandler\ErrorHandler::handleFatalError()                
[1/2] OutOfMemoryError
Symfony\Component\ErrorHandler\Error\OutOfMemoryError:
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2101248 bytes)

  at /var/www/html/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php:166