[RHBK] Getting "dns_query can not be null or empty" when creating a temporary admin user

Solution Verified - Updated -

Environment

  • Red Hat build of Keycloak
    • 26.x

Issue

  • Getting "ISPN000541" related error when creating a temporary admin user in Red Hat build of Keycloak
  • Getting "dns_query can not be null or empty" error when creating a temporary admin user in Red Hat build of Keycloak

Resolution

  • Since bootstrap-admin command automatically starts and stop the RHBK server, a workaround can be applied to switching to the local stack by setting environment variable KC_CACHE=local or passing --cache=local in the /kc.sh bootstap-admin command

  • Setting cache to local will start the RHBK server with bootstrap-admin command to create the temporary user and stop the server upon creation.

Root Cause

  • The error message java.lang.IllegalArgumentException: dns_query can not be null or empty" indicates that the jgroups.dns.query property is missing.
  • This property is a default requirement for Infinispan's Kubernetes stack.

Diagnostic Steps

  • Setting cache to local might result in other errors like Unable to start the management interface or Address already in use. However, the bootstrap-admin command first creates the temporary user before attempting to start the server. Look for log like KC-SERVICES0077: Created temporary admin user with username admin1 to confirm the creation of temporary user.
  • Once temporary user is created without errors, revert the local cache setting and start Red Hat Keycloak server to verify temporary admin login.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments