-
Bug
-
Resolution: Done
-
Undefined
-
None
-
False
-
-
False
-
-
Before reporting an issue
[x] 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
The method org.keycloak.connections.jpa.PersistenceExceptionConverter#convert inspects Throwable objects in order to wrap the exception; one of the checks it does is
throwable instanceof SQLException bue && bue.getSQLState().startsWith("23")
I have observed during AWS MySQL RDS failovers that SQLException}}s can be throw that have a {{null response to getSQLState causing this method to throw an NPE rather than the expected model exception classes
Version
26.0.1
Regression
[ ] The issue is a regression
Expected behavior
a ModelException instance is thrown
Actual behavior
a NullPointerException instance is thrown
How to Reproduce?
I'm sure there is a simpler way, but the way I have reproduced the issue
- create an AWS MySQL RDS instance across availability zones
- deploy keycloak pointing at above RDS instance for database
- log in to keycloak and click around admin console a bit to make sure some mysql connections are in the pool
- use AWS RDS console to restart (with failover) the RDS instance
Anything else?
No response
- links to