8000 SQL error when logging in for first time (per user) after Keycloak upgrade · Issue #40171 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
SQL error when logging in for first time (per user) after Keycloak upgrade #40171
Closed
@minusdavid

Description

@minusdavid

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

core

Describe the bug

After upgrading from an older version to Keycloak 26.2.5, there is a step where the password is upgraded from the past format to argon2.

When the user tries to login they get an "Internal server error" message and in the Keycloak logs I see:
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update CREDENTIAL set CREATED_DATE=?,CREDENTIAL_DATA=?,PRIORITY=?,SALT=?,SECRET_DATA=?,TYPE=?,USER_ID=?,USER_LABEL=?,VERSION=? where ID=? and VERSION=?

If they retry the login again, they're logged in and the password is upgraded.

Version

26.2.5

Regression

  • The issue is a regression

Expected behavior

I would expect the user to be logged in and the password upgrade to happen seamlessly.

Actual behavior

The first login attempt fails, the second login attempt succeeds.

How to Reproduce?

Upgrade from a much older version of Keycloak (using stepped upgrades between major changes like the move from Wildfly to Quarkus and then first Quarkus to latest Quarkus), and try to login.

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0