Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migration to persistent sessions fails from Keycloak version <22 #32195

@mhajas

Description

@mhajas

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

storage

Describe the bug

This PR: #17525 introduced a new client session note clientId. This means all client sessions created in KC 22 or newer have this note. However, the sessions created by an older version do not have this note.

The persistent user sessions migration is relying on that note to be present and if it is not there, the migration fails with:

..."java.lang.NullPointerException","message":"Cannot invoke \"String.startsWith(String)\" because \"id\" is null"...

as reported here:
#28271 (comment)

Version

25.0.2

Regression

  • The issue is a regression

Expected behavior

The migration works even if client sessions were created by an older KC version

Actual behavior

The migration fails

How to Reproduce?

  1. Run KC 21 and create some sessions
  2. Run KC 25 with enabled persistent-user-sessions feature
  3. Migration fails

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions