Error When Setting up OTP After Upgrading Keycloak

After upgrading from keycloak 16.1.0, then to 17.0.1, then to 21.0.2, the configure otp action has broken. If the configure otp action is set to required, any new user gets an error when trying to setup their otp. The error on the web page is “An internal server error has occurred”. The error in the keycloak logs is, “ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-334) Uncaught server error: java.lang.NoClassDefFoundError: Could not initialize class java.awt.image.BufferedImage.” I am not seeing any other issues with the Keycloak installation and i have verified that openjdk 11 (java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64) is installed. The Keycloak installation is running on Centos 7. The Keycloak application is running as the local linux keycloak user.

I was unable to find a solution to this issue through searching online. Thanks.

1 Like

This seems like a bug. Could you report it at Issues · keycloak/keycloak · GitHub? Could you try reproducing it using the keycloak container image to see it that’s not a java installation issue?

1 Like

Thank you @weltonrodrigo for responding. I restarted the operating system and is seems to be working now.