Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session/EntityManager is closed when using infinispan and attempting to update the realm #23943

Closed
2 tasks done
alice-wondered opened this issue Oct 12, 2023 · 1 comment · Fixed by #23944
Closed
2 tasks done
Labels
area/core kind/bug Categorizes a PR related to a bug

Comments

@alice-wondered
Copy link
Contributor

alice-wondered commented Oct 12, 2023

Before reporting an issue

Area

admin/ui

Describe the bug

This bug most readily presents itself when attempting to use the session revocation feature in the admin UI.

Only happens when using infinispan, any request to update the realm fails.

Version

Nightly

Expected behavior

The realm should be able to update and the hibernate entity manager should not be closed for the current session

Actual behavior

Error returns, request fails, realm does not update, error message says that the entity manager is closed

How to Reproduce?

This bug most readily presents itself when attempting to use the session revocation feature in the admin UI.

Run keycloak using legacy store and infinispan.
Login to the admin console, navigate to sessions. In the top right corner click the dropdown and select "Revocation". Select "Set To Now". The request will fail. This is also seen in GHA. In the session_spec for UI tests in cypress there is a test that does exactly this and fails due to this bug.

While the revocation feature is no longer needed according to other discussion threads, this bug is actually caused by behavior in an unrelated class when updating a realm and most likely affects other areas of the UI.

Anything else?

I have diagnosed this issue and will be submitting a PR to resolve. It is caused by persistence of a cached realm model on OAuth2DeviceConfig in infinispan, causing a reference to an old session and entity manager instead of the most up to date

@ssilvert
Copy link
Contributor

Good PRs are always welcome!

This doesn't sound like a UI issue, so I'm moving it to the core team.

ahus1 pushed a commit to alice-wondered/keycloak that referenced this issue Oct 13, 2023
…sisting old session and entity manager in infinispan fixes keycloak#23943
ahus1 pushed a commit that referenced this issue Oct 16, 2023
…sisting old session and entity manager in infinispan fixes #23943
@ghost ghost removed the status/triage label Oct 16, 2023
rblaine95 added a commit to didx-xyz/yoma that referenced this issue Nov 22, 2023
* Keycloak `22.0.4` (keycloak/keycloak#23943)
* Keycloak Config CLI `5.9.0-22.0.4`
* Keycloak Webhooks `0.4.0`
* Tailscale `1.54.0`
rblaine95 added a commit to didx-xyz/yoma that referenced this issue Nov 22, 2023
* Keycloak `22.0.4`
  * keycloak/keycloak#23943
  * adorsys/keycloak-config-cli#939
* Keycloak Config CLI `5.9.0-22.0.4`
* Keycloak Webhooks `0.4.0`
* Tailscale `1.54.0`
rblaine95 added a commit to didx-xyz/yoma that referenced this issue Nov 22, 2023
* Keycloak `22.0.4`
  * keycloak/keycloak#23943
  * adorsys/keycloak-config-cli#939
* Keycloak Config CLI `5.9.0-22.0.4`
* Keycloak Webhooks `0.4.0`
* Tailscale `1.54.0`
rblaine95 added a commit to didx-xyz/yoma that referenced this issue Nov 22, 2023
* Keycloak `22.0.4`
  * keycloak/keycloak#23943
  * adorsys/keycloak-config-cli#939
* Keycloak Config CLI `5.9.0-22.0.4`
* Keycloak Webhooks `0.4.0`
* Tailscale `1.54.0`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core kind/bug Categorizes a PR related to a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants