Skip to content

Unable to set up a cluster with two nodes using TCPPING as explained in the guide #88

Description

@pradhanv

Followed the steps mentioned in the Readme documentation of
embedded-spring-boot-keycloak-server to setup a cluster of two nodes using TCPPING. The nodes came up and the following logs were observed on the two nodes.

Node 1:

2024-09-19 13:57:45.500  INFO 1998000 --- [           main] c.g.t.k.embedded.EmbeddedKeycloakConfig  : Using infinispan configuration from jar:file:/home/ubuntu/thomas_keycloak/embedded-keycloak-server-custom-undertow-1.0.0-SNAPSHOT-INFO.jar!/BOOT-INF/classes!/infinispan.xml
2024-09-19 13:57:46.409  WARN 1998000 --- [           main] org.infinispan.PERSISTENCE               : ISPN000554: jboss-marshalling is deprecated and planned for removal
2024-09-19 13:57:46.457  INFO 1998000 --- [           main] org.infinispan.CONTAINER                 : ISPN000556: Starting user marshaller 'org.infinispan.commons.marshall.ImmutableProtoStreamMarshaller'
2024-09-19 13:57:46.613  INFO 1998000 --- [           main] org.infinispan.CONTAINER                 : ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.8.Final
2024-09-19 13:57:46.858  INFO 1998000 --- [           main] org.infinispan.CLUSTER                   : ISPN000078: Starting JGroups channel `ISPN` with stack `jgroups`
2024-09-19 13:57:46.943  WARN 1998000 --- [           main] org.jgroups.stack.Configurator           : JGRP000014: STABLE.stability_delay has been deprecated: always 0

-------------------------------------------------------------------
GMS: address=ip-172-31-27-116-412, cluster=ISPN, physical address=172.31.27.116:7600
-------------------------------------------------------------------
2024-09-19 13:57:48.502  INFO 1998000 --- [           main] org.jgroups.protocols.pbcast.GMS         : ip-172-31-27-116-412: no members discovered after 1502 ms: creating cluster as coordinator
2024-09-19 13:57:48.512  INFO 1998000 --- [           main] org.infinispan.CLUSTER                   : ISPN000094: Received new cluster view for channel ISPN: [ip-172-31-27-116-412|0] (1) [ip-172-31-27-116-412]
2024-09-19 13:57:48.574 ERROR 1998000 --- [           main] org.jgroups.JChannel                     : JGRP000016: exception in channelConnected callback: java.lang.NullPointerException: Cannot invoke "org.infinispan.metrics.impl.MetricsCollector.registerMetrics(Object, java.util.Collection, String, String)" because "mc" is null
2024-09-19 13:57:48.575  INFO 1998000 --- [           main] org.infinispan.CLUSTER                   : ISPN000079: Channel `ISPN` local address is `ip-172-31-27-116-412`, physical addresses are `[172.31.27.116:7600]`

Node 2:

2024-09-19 13:59:48.236  INFO 43876 --- [           main] c.g.t.k.embedded.EmbeddedKeycloakConfig  : Using infinispan configuration from jar:file:/home/ubuntu/thomas_keycloak/embedded-keycloak-server-custom-undertow-1.0.0-SNAPSHOT-INFO.jar!/BOOT-INF/classes!/infinispan.xml
2024-09-19 13:59:49.270  WARN 43876 --- [           main] org.infinispan.PERSISTENCE               : ISPN000554: jboss-marshalling is deprecated and planned for removal
2024-09-19 13:59:49.319  INFO 43876 --- [           main] org.infinispan.CONTAINER                 : ISPN000556: Starting user marshaller 'org.infinispan.commons.marshall.ImmutableProtoStreamMarshaller'
2024-09-19 13:59:49.477  INFO 43876 --- [           main] org.infinispan.CONTAINER                 : ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.8.Final
2024-09-19 13:59:49.758  INFO 43876 --- [           main] org.infinispan.CLUSTER                   : ISPN000078: Starting JGroups channel `ISPN` with stack `jgroups`
2024-09-19 13:59:49.842  WARN 43876 --- [           main] org.jgroups.stack.Configurator           : JGRP000014: STABLE.stability_delay has been deprecated: always 0

-------------------------------------------------------------------
GMS: address=ip-172-31-27-189-65026, cluster=ISPN, physical address=172.31.27.189:7600
-------------------------------------------------------------------
2024-09-19 13:59:49.960  INFO 43876 --- [           main] org.infinispan.CLUSTER                   : ISPN000094: Received new cluster view for channel ISPN: [ip-172-31-27-116-412|1] (2) [ip-172-31-27-116-412, ip-172-31-27-189-65026]
2024-09-19 13:59:50.019 ERROR 43876 --- [           main] org.jgroups.JChannel                     : JGRP000016: exception in channelConnected callback: java.lang.NullPointerException: Cannot invoke "org.infinispan.metrics.impl.MetricsCollector.registerMetrics(Object, java.util.Collection, String, String)" because "mc" is null
2024-09-19 13:59:50.021  INFO 43876 --- [           main] org.infinispan.CLUSTER                   : ISPN000079: Channel `ISPN` local address is `ip-172-31-27-189-65026`, physical addresses are `[172.31.27.189:7600]`

A network load balancer was placed in front of the two nodes and the Admin console was accessed. On trying to login, there were exceptions observed in the logs and the login was not successful.

2024-09-19 13:19:57.764 DEBUG 1996782 --- [  XNIO-1 task-4] o.k.a.DefaultAuthenticationFlow          : invoke authenticator.authenticate: auth-username-password-form
2024-09-19 13:19:57.771 ERROR 1996782 --- [  XNIO-1 task-4] io.undertow.request                      : UT005023: Exception handling request to /auth/realms/master/protocol/openid-connect/auth
java.lang.NullPointerException: Cannot invoke "org.keycloak.models.RealmModel.getSsoSessionMaxLifespan()" because "realm" is null
        at org.keycloak.models.sessions.infinispan.util.SessionTimeouts.getUserSessionLifespanMs(SessionTimeouts.java:54) ~[keycloak-model-infinispan-18.0.0.jar!/:18.0.0]
        at org.keycloak.models.sessions.infinispan.changes.InfinispanChangelogBasedTransaction.commitImpl(InfinispanChangelogBasedTransaction.java:165) ~[keycloak-model-infinispan-18.0.0.jar!/:18.0.0]

The complete stack trace of the exception can be found in the attachment.

Could you please help with the latest documentation and configuration for a clustered setup? Specifically, could you please provide a working example for JDBCPING as we intend to setup the cluster on AWS Elastic Container Service.
admin_console_exception.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions