Keycloak 26.4.7 HA

Hello,

I am encountering a problem that I cannot understand in my Keycloak deployment in HA with Infinispan.
I am deploying my Keycloak using the Ansible Keycloak Ansible-middleware collection (GitHub - ansible-middleware/keycloak: Collection to install and configure Keycloak or Red Hat Single Sign-On / Red Hat Build of Keycloak), but I am getting this error:

ERROR: ISPN000540: No such JGroups stack 'JDBC_PING2'

With complete logs:

2025-12-10 13:52:18,404 INFO  [org.hibernate.orm.jdbc.batch] (JPA Startup Thread) HHH100501: Automatic JDBC statement batching enabled (maximum batch size 32)
2025-12-10 13:52:19,297 WARN  [org.keycloak.spi.infinispan.impl.embedded.CacheConfigurator] (main) Modifying the default cache configuration in the config file without setting cache-config-mutate=true is deprecated.
2025-12-10 13:52:19,326 INFO  [com.arjuna.ats.jbossatx] (main) ARJUNA032014: Stopping transaction recovery manager
2025-12-10 13:52:19,356 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2025-12-10 13:52:19,356 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: ISPN000540: No such JGroups stack 'JDBC_PING2'
2025-12-10 13:52:19,356 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.

Ma configuration Infinispan est la suivante:

<infinispan
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:infinispan:config:15.0 http://www.infinispan.org/schemas/infinispan-config-15.0.xsd"
        xmlns="urn:infinispan:config:15.0">


    <cache-container name="keycloak">
        <transport lock-timeout="60000" stack="JDBC_PING2"/>
        <local-cache name="realms" simple-cache="true">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <memory max-count="10000"/>
        </local-cache>
        <local-cache name="users" simple-cache="true">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <memory max-count="10000"/>
        </local-cache>
        <distributed-cache name="sessions" owners="2">
            <expiration lifespan="-1"/>
            <memory max-count="10000"/>
        </distributed-cache>
        <distributed-cache name="authenticationSessions" owners="2">
            <expiration lifespan="-1"/>
        </distributed-cache>
        <distributed-cache name="offlineSessions" owners="2">
            <expiration lifespan="-1"/>
            <memory max-count="10000"/>
        </distributed-cache>
        <distributed-cache name="clientSessions" owners="2">
            <expiration lifespan="-1"/>
            <memory max-count="10000"/>
        </distributed-cache>
        <distributed-cache name="offlineClientSessions" owners="2">
            <expiration lifespan="-1"/>
            <memory max-count="10000"/>
        </distributed-cache>
        <distributed-cache name="loginFailures" owners="2">
            <expiration lifespan="-1"/>
        </distributed-cache>
        <local-cache name="authorization" simple-cache="true">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <memory max-count="10000"/>
        </local-cache>
        <replicated-cache name="work">
            <expiration lifespan="-1"/>
        </replicated-cache>
        <local-cache name="keys" simple-cache="true">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <expiration max-idle="3600000"/>
            <memory max-count="1000"/>
        </local-cache>
        <local-cache name="crl" simple-cache="true">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <expiration lifespan="-1"/>
            <memory max-count="1000"/>
        </local-cache>
        <distributed-cache name="actionTokens" owners="2">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <expiration max-idle="-1" lifespan="-1" interval="300000"/>
            <memory max-count="-1"/>
        </distributed-cache>
    </cache-container>
</infinispan>

I feel like I’m missing a JGroups in the Infinispan configuration, except that this configuration is the default configuration used in the collection.

Has anyone else encountered this problem?

Thank you :slight_smile:

  1. Does it work without your custom XML configuration file?
  2. Do you really need a custom XML configuration file (why)?

Hi,

Thanks for your response.

  1. It works without the custom configuration but it also works if I remove the stack="JDBC_PING2" from the cache configuration file.
  2. Actually, this file is deployed when you activate the HA option on the ansible_middleware.keycloak collection. See keycloak/roles/keycloak_quarkus/templates/cache-ispn.xml.j2 at main · ansible-middleware/keycloak

Seems that the Ansible collection is not yet updated (the Ansible collection is community-maintained, not an official Keycloak project!).

The current cache-ispn.xml file is this one: keycloak/quarkus/runtime/src/main/resources/cache-ispn.xml at main · keycloak/keycloak · GitHub
As you can see, it’s pretty empty…
Infinispan should - in regular deployments - no more being configured through the XML file, but only through Keycloak config options (see Configuring distributed caches - Keycloak).

1 Like

Okay. I understand. I already have a pull request open on the project. I will update it to make adding the ispn cache file configurable.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.