- Issue created by @joseph.olstad
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 4:19pm 27 July 2023
keycloak logout crashing issue I noticed in Test-environment that has an undetermined reproducability vector, I found a way out of it,so keycloak can in some weird situation be unable to find it's own service and crash in a certain situation of install/config/ login session creation time, not sure exactly how to reproduce exactly but I figured out how to get it out of the signout crashing
A) turn off/disable "Enable Drupal-initiated single sign-out"
B) then rebuilt caches
C) log out
D) log back in as an admin user
E) turn back on/Re-enable "Enable Drupal-initiated single sign-out"
F) sign out again, no issue, no more exception
G) Problem solved, but why is the workaround needed?
TypeError: Drupal\keycloak\Controller\KeycloakController::__construct(): Argument #3 ($plugin_manager) must be of type Drupal\openid_connect\Plugin\OpenIDConnectClientPluginManager, Drupal\openid_connect\Plugin\OpenIDConnectClientManager given, called in /www/html/modules/contrib/keycloak/src/Controller/KeycloakController.php on line 107 in Drupal\keycloak\Controller\KeycloakController->__construct() (line 81 of /www/html/modules/contrib/keycloak/src/Controller/KeycloakController.php)
#0 /www/html/modules/contrib/keycloak/src/Controller/KeycloakController.php(107): Drupal\keycloak\Controller\KeycloakController->__construct(Object(Drupal\keycloak\Service\KeycloakService), Object(Drupal\Core\Session\AccountProxy), Object(Drupal\openid_connect\Plugin\OpenIDConnectClientManager), Object(Drupal\openid_connect\OpenIDConnectClaims), Object(Drupal\openid_connect\OpenIDConnectSession), Object(Drupal\Core\Http\RequestStack))
#1 /www/html/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(28): Drupal\keycloak\Controller\KeycloakController::create(Object(Drupal\Core\DependencyInjection\Container))
#2 /www/html/modules/contrib/layout_builder_st/src/DependencyInjection/ClassResolver.php(18): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\keycloa...')
#3 /www/html/core/lib/Drupal/Core/Controller/ControllerResolver.php(117): Drupal\layout_builder_st\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\keycloa...')
#4 /www/html/core/lib/Drupal/Core/Controller/ControllerResolver.php(69): Drupal\Core\Controller\ControllerResolver->createController('\\Drupal\\keycloa...')
#5 /www/html/core/lib/Drupal/Core/Controller/ControllerResolver.php(85): Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\\Drupal\\keycloa...', '/en/user/logout')
#6 /drupal/vendor/symfony/http-kernel/HttpKernel.php(152): Drupal\Core\Controller\ControllerResolver->getController(Object(Symfony\Component\HttpFoundation\Request))
#7 /drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#8 /www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /www/html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /www/html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#17 {main}
Log into a site, deploy keycloak configuration that installs and configures keycloak while still logged in
make sure your network has a reverse proxy that prevents single signon logouts from occuring
if this scenario is produced once keycloak is installed then try to log out, visiting /user/logout should cause the exception.
The workaround fix is described above in steps A through F
Find the root cause of the issue, until then use the workaround
The workaround fix is described above in steps A through F
Find the root cause of the issue, improve the code base so that this doesn't occur, or at least handle the exception in a helpful way.
TBD
TBD
TBD
Needs review
2.2
Code