Exceptions
Exception
Symfony\Component\Mercure\Exception\ RuntimeException
in
vendor/symfony/mercure/src/Authorization.php
(line 205)
if ($currentDomain === $cookieDomain || str_ends_with($cookieDomain, $target)) {return $target;}}throw new RuntimeException(\sprintf('Unable to create authorization cookie for a hub on the different second-level domain "%s".', $cookieDomain));}private function updateCookies(Request $request, ?string $hub, Cookie $cookie): void{$hub = (string) $hub;
in
vendor/symfony/mercure/src/Authorization.php
->
getCookieDomain
(line 121)
if (!$cookieLifetime instanceof \DateTimeInterface && 0 !== $cookieLifetime) {$cookieLifetime = new \DateTimeImmutable("+{$cookieLifetime} seconds");}$path = $urlComponents['path'] ?? '/';$domain = $this->getCookieDomain($request, $urlComponents);$secure = 'http' !== strtolower($urlComponents['scheme'] ?? 'https');return Cookie::create($this->getCookieName($hubInstance, $secure),$token,
in
vendor/symfony/mercure/src/Authorization.php
->
createCookie
(line 57)
* @param array<string, mixed> $additionalClaims an array of additional claims for the JWT* @param string|null $hub the hub to generate the cookie for*/public function setCookie(Request $request, array|string|null $grants = [], string|array|null $publish = null, array $additionalClaims = [], ?string $hub = null): void{$this->updateCookies($request, $hub, $this->createCookie($request, $grants, $publish, $additionalClaims, $hub));}/*** Clears the subscriber authorization cookie for the given hub.*
Authorization->setCookie(object(Request), array('https://agent-control.local/projects/01a0bf6e-7534-7811-95ba-5a03539ef3c8'), null, array('exp' => object(DatePoint)))
in
src/Project/UI/Http/LiveSubscriptionController.php
(line 42)
#[IsGranted(ProjectPermission::View->value, subject: 'project', statusCode: Response::HTTP_NOT_FOUND)]public function __invoke(Project $project, Request $request, Authorization $mercureAuthorization): JsonResponse{$topic = LiveUpdateTopic::project($project->getId());$expiresAt = $this->clock->now()->modify(\sprintf('+%d seconds', self::GRANT_SECONDS));$mercureAuthorization->setCookie($request, [$topic], additionalClaims: ['exp' => $expiresAt]);return new JsonResponse(['topic' => $topic, 'hubUrl' => $this->hub->getPublicUrl(), 'expiresAt' => $expiresAt->format(\DATE_ATOM)],Response::HTTP_OK,['Cache-Control' => 'no-store, private'],
in
vendor/symfony/http-kernel/HttpKernel.php
->
__invoke
(line 188)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $controllerMetadata);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 79)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type, $controllerMetadata);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 143)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 34)
) {}public function run(): int{$response = $this->kernel->handle($this->request);$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {fastcgi_finish_request();
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
declare(strict_types=1);use App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return static fn (array $context): Kernel => new Kernel(is_string($context['APP_ENV'] ?? null) ? $context['APP_ENV'] : 'prod',filter_var($context['APP_DEBUG'] ?? false, FILTER_VALIDATE_BOOL),);
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 16:35:25 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "0856c0"
},
"request_uri": "https://agent.ws-thiele.de/_profiler/0856c0",
"method": "GET"
}
|
Stack Trace
|
RuntimeException
|
|---|
Symfony\Component\Mercure\Exception\RuntimeException:
Unable to create authorization cookie for a hub on the different second-level domain "localhost".
at vendor/symfony/mercure/src/Authorization.php:205
at Symfony\Component\Mercure\Authorization->getCookieDomain(object(Request), array('scheme' => 'http', 'host' => 'localhost', 'port' => 8088, 'path' => '/.well-known/mercure'))
(vendor/symfony/mercure/src/Authorization.php:121)
at Symfony\Component\Mercure\Authorization->createCookie(object(Request), array(object(Grant)), null, array('exp' => object(DatePoint)), null)
(vendor/symfony/mercure/src/Authorization.php:57)
at Symfony\Component\Mercure\Authorization->setCookie(object(Request), array('https://agent-control.local/projects/01a0bf6e-7534-7811-95ba-5a03539ef3c8'), null, array('exp' => object(DatePoint)))
(src/Project/UI/Http/LiveSubscriptionController.php:42)
at App\Project\UI\Http\LiveSubscriptionController->__invoke(object(Project), object(Request), object(Authorization))
(vendor/symfony/http-kernel/HttpKernel.php:188)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1, object(ControllerArgumentsMetadata))
(vendor/symfony/http-kernel/HttpKernel.php:79)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:143)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/app/vendor/autoload_runtime.php')
(public/index.php:7)
|