CookieConsent Offcanvas Menu AccessDeniedHttpException

Hi,

ich habe ein Shopware 6 Instanz aktualisiert und seit dem ein Problem mit dem Cookie Consent Offcanvas Menu.

Die Seite kann nicht angezeigt werden. Der Debugger bringt im DEV Mode einen Fehler:

PageController can’t be requested via XmlHttpRequest.

AccessDeniedHttpException

Version ist jetzt v6.4.7.0 Stable Version

Ich habe alle Plugins deaktiviert und das Theme auf Shopware Standard zurückgestellt.
Theme wurde kompiliert und Cache geleert.

Hat irgendjemand eine Idee wie ich das Problem greifen kann?

Danke.

Gruß,
Leif

Das Cookie Consent kann per XmlHttpRequest aufgerufen werden. Bist du dir sicher, dass dessen Controller den Fehler wirft?

Hallo @Max_Shop
danke für deine Antwort.

Es schaut als ob mit dem Routing insgesamt was schief läuft.

Hier noch die genaueren Fehler, die ausgeworfen werden:

Symfony\Component\HttpKernel\Exception\
AccessDeniedHttpException

in vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php (line 290)
        if ($isAllowed) {            return;        }        throw new AccessDeniedHttpException('PageController can\'t be requested via XmlHttpRequest.');    }    // used to switch session token - when the context token expired    public function replaceContextToken(SalesChannelContextResolvedEvent $event): void    {

in vendor/symfony/event-dispatcher/Debug/WrappedListener.php -> preventPageLoadingFromXmlHttpRequest (line 117)
        $this->called = true;        $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);        $e = $this->stopwatch->start($this->name, 'event_listener');        ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);        if ($e->isStarted()) {            $e->stop();        }

in vendor/symfony/event-dispatcher/EventDispatcher.php -> __invoke (line 230)
        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.

in vendor/symfony/event-dispatcher/EventDispatcher.php -> callListeners (line 59)
        } else {            $listeners = $this->getListeners($eventName);        }        if ($listeners) {            $this->callListeners($listeners, $eventName, $event);        }        return $event;    }

in vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php -> dispatch (line 50)
     *     * @return TEvent     */    public function dispatch($event, ?string $eventName = null): object    {        $event = $this->dispatcher->dispatch($event, $eventName);        if (!$event instanceof FlowEventAware) {            return $event;        }

in vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php -> dispatch (line 94)
     *     * @return TEvent     */    public function dispatch($event, ?string $eventName = null): object    {        $event = $this->dispatcher->dispatch($event, $eventName);        foreach ($this->eventFactory->createHookablesFor($event) as $hookable) {            $context = Context::createDefaultContext();            if (Feature::isActive('FEATURE_NEXT_17858')) {                if ($event instanceof FlowEventAware || $event instanceof AppChangedEvent || $event instanceof EntityWrittenContainerEvent) {

in vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php -> dispatch (line 52)
    public function dispatch($event, ?string $eventName = null): object    {        Feature::triggerDeprecated('FEATURE_NEXT_17858', 'v6.4.6', '6.5.0', 'Will be removed in v6.5.0, use FlowDispatcher instead.');        $event = $this->dispatcher->dispatch($event, $eventName);        if (Feature::isActive('FEATURE_NEXT_17858')) {            return $event;        }

in vendor/shopware/core/Framework/Event/NestedEventDispatcher.php -> dispatch (line 32)
                }                $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     */

in vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php -> dispatch (line 151)
        try {            $this->beforeDispatch($eventName, $event);            try {                $e = $this->stopwatch->start($eventName, 'section');                try {                    $this->dispatcher->dispatch($event, $eventName);                } finally {                    if ($e->isStarted()) {                        $e->stop();                    }                }

in vendor/symfony/http-kernel/HttpKernel.php -> dispatch (line 144)
        if (false === $controller = $this->resolver->getController($request)) {            throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo()));        }        $event = new ControllerEvent($this, $controller, $request, $type);        $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER);        $controller = $event->getController();        // controller arguments        $arguments = $this->argumentResolver->getArguments($request, $controller);

in vendor/symfony/http-kernel/HttpKernel.php -> handleRaw (line 78)
    public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)    {        $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());        try {            return $this->handleRaw($request, $type);        } catch (\Exception $e) {            if ($e instanceof RequestExceptionInterface) {                $e = new BadRequestHttpException($e->getMessage(), $e);            }            if (false === $catch) {

in vendor/symfony/http-kernel/Kernel.php -> handle (line 199)
        $this->boot();        ++$this->requestStackSize;        $this->resetServices = true;        try {            return $this->getHttpKernel()->handle($request, $type, $catch);        } finally {            --$this->requestStackSize;        }    }

in vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php -> handle (line 86)
        if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {            Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());        }        try {            return $kernel->handle($request, $type, $catch);        } finally {            // restore global state            Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);        }    }

in vendor/symfony/http-kernel/HttpCache/HttpCache.php :: handle (line 479)
        if ($this->surrogate) {            $this->surrogate->addSurrogateCapability($request);        }        // always a "master" request (as the real master request can be in cache)        $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);        /*         * Support stale-if-error given on Responses or as a config option.         * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual         * Cache-Control directives) that

in vendor/symfony/http-kernel/HttpCache/HttpCache.php -> forward (line 452)
        // avoid that the backend sends no content        $subRequest->headers->remove('If-Modified-Since');        $subRequest->headers->remove('If-None-Match');        $response = $this->forward($subRequest, $catch);        if ($response->isCacheable()) {            $this->store($request, $response);        }

in vendor/symfony/http-kernel/HttpCache/HttpCache.php -> fetch (line 346)
        }        if (null === $entry) {            $this->record($request, 'miss');            return $this->fetch($request, $catch);        }        if (!$this->isFreshEnough($request, $entry)) {            $this->record($request, 'stale');

in vendor/symfony/http-kernel/HttpCache/HttpCache.php -> lookup (line 224)
                reload the cache by fetching a fresh response and caching it (if possible).            */            $this->record($request, 'reload');            $response = $this->fetch($request, $catch);        } else {            $response = $this->lookup($request, $catch);        }        $this->restoreResponseBody($request, $response);        if (HttpKernelInterface::MAIN_REQUEST === $type) {

in vendor/shopware/core/HttpKernel.php -> handle (line 181)
            && $container->getParameter('shopware.http.cache.enabled');        if ($enabled && $container->has(CacheStore::class)) {            $kernel = new HttpCache($kernel, $container->get(CacheStore::class), null, ['debug' => $this->debug]);        }        $response = $kernel->handle($transformed, $type, $catch);        // fire event to trigger runtime events like seo url headers        $event = new BeforeSendResponseEvent($transformed, $response);        $container->get('event_dispatcher')->dispatch($event);

in vendor/shopware/core/HttpKernel.php -> doHandle (line 81)
    }    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): HttpKernelResult    {        try {            return $this->doHandle($request, (int) $type, (bool) $catch);        } catch (DBALException $e) {            $connectionParams = self::getConnection()->getParams();            $message = str_replace([$connectionParams['url'], $connectionParams['password'], $connectionParams['user']], '******', $e->getMessage());

HttpKernel->handle(object(Request))
in public/index.php (line 77)
}$request = Request::createFromGlobals();$kernel = new HttpKernel($appEnv, $debug, $classLoader);$result = $kernel->handle($request);$result->getResponse()->send();$kernel->terminate($result->getRequest(), $result->getResponse());