Skip to content

Conversation

@tylerpotts
Copy link
Contributor

Reference Issues or PRs

Fixes #2495

What does this implement/fix?

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):
    Software update for Keycloak

Documentation

  • For new features or enhancements, a corresponding PR has been opened in the documentation repository (if applicable)
    • Link to docs PR:

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

How to test this PR?

  • Deploy a cluster based on the 2025.10.1 version
  • Add a user to keycloak (to verify that there is a user to be backed up)
  • Run nebari upgrade -c <config_file> to automatically generate a backup of keycloak
  • Run nebari deploy -c <config_file and the keycloak database will be restored to the new database

Any other comments?

@tylerpotts tylerpotts requested a review from a team as a code owner November 5, 2025 22:07
@tylerpotts tylerpotts requested review from dcmcand and marcelovilla and removed request for a team November 5, 2025 22:07
@tylerpotts tylerpotts changed the title Keycloak Upgrade [WIP] Keycloak Upgrade Nov 5, 2025
@viniciusdc
Copy link
Contributor

That error is handled by us here:

def create_jupyterhub_token(note):
session = get_jupyterhub_session()
try:
# Retrieve the XSRF token from session cookies
xsrf_token = session.cookies.get("_xsrf")
except requests.cookies.CookieConflictError:
xsrf_token = session.cookies.get("_xsrf", path="/hub/")
if not xsrf_token:
raise ValueError("XSRF token not found in session cookies.")
headers = {
"Referer": f"https://{constants.NEBARI_HOSTNAME}/hub/token",
"X-XSRFToken": xsrf_token,
}

I have a feeling the client API on the newer keycloak might have moved a few settings to other places, usually, I see those XSRF errors when there is a misconfiguration within the OAuth client. We are currently passing through that stage during deployment, but it might be beneficial to update the provider as well, depending on how the API is called under the hood.

I think something else is erroring out, and it ends up being picked by that try block. I would compare the keycloak clients configuration available on a deploy from this branch vs a current deployment to see if there is anything that pops up -- usually at the redirection URLs.

Since I see some errors with missing groups

tests/tests_deployment/test_conda_store_roles_loaded.py::test_conda_store_roles_loaded_from_keycloak[admin!namespace=analyst,developer!namespace=nebari-git-changed_scopes0] - KeyError: 'nebari-git/*'
FAILED tests/tests_deployment/test_conda_store_roles_loaded.py::test_conda_store_roles_loaded_from_keycloak[admin!namespace=analyst,developer!namespace=invalid-namespace-changed_scopes1] - KeyError: 'analyst/*'
FAILED 

@tylerpotts tylerpotts changed the title [WIP] Keycloak Upgrade Keycloak Upgrade Nov 13, 2025
@tylerpotts tylerpotts mentioned this pull request Nov 13, 2025
11 tasks
@github-project-automation github-project-automation bot moved this from New 🚦 to Changes requested 🧱 in 🪴 Nebari Project Management Nov 25, 2025
@tylerpotts tylerpotts requested a review from dcmcand November 26, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Changes requested 🧱

Development

Successfully merging this pull request may close these issues.

[ENH] - Upgrade Keycloak to 20.0.4

4 participants