Describe the bug
When database access, e.g. to add a token to the database fails for any reason with a SQLException, this exception is caught and a database migration is attempted.
In case the database is already using the appropriate schema, this migration fails and the root cause of the original failure is never logged.
Steps to Reproduce
We cannot tell what the actual current issue with our database is, because the error is not logged. To force the issue, you may use a debugger and force an exception during DB insert. Maybe you can attempt to insert a new OIDC client with an overly long name or id.
Expected behavior
Root cause should be available as FFDC or warning.
Diagnostic information:
OpenLiberty Version: up to including 21.0.0.10
Affected feature(s) : openidConnectProvider
Java Version:
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 8.0.6.35 - pxa6480sr6fp35-20210714_01(SR6 FP35))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20210622_7763 (JIT enabled, AOT enabled)
OpenJ9 - b1f3adb
OMR - c2f4a18
IBM - c24a144)
JCL - 20210625_01 based on Oracle jdk8u301-b09
server.xml n/a (the exact issue happened with Db2, but the code affects all databases)
If it would be useful, upload the messages.log file found in $WLP_OUTPUT_DIR/messages.log
Describe the bug
When database access, e.g. to add a token to the database fails for any reason with a SQLException, this exception is caught and a database migration is attempted. In case the database is already using the appropriate schema, this migration fails and the root cause of the original failure is never logged.
Steps to Reproduce
We cannot tell what the actual current issue with our database is, because the error is not logged. To force the issue, you may use a debugger and force an exception during DB insert. Maybe you can attempt to insert a new OIDC client with an overly long name or id.
Expected behavior
Root cause should be available as FFDC or warning.
Diagnostic information:
$WLP_OUTPUT_DIR/messages.log
https://github.com/OpenLiberty/open-liberty/blob/427439c048275927a83bd7da54d1adf9528aa8f1/dev/com.ibm.ws.security.oauth/src/com/ibm/ws/security/oauth20/plugins/db/CachedDBOidcTokenStore.java#L459
Additional context
n/a