jgroups-extras / jgroups-aws

Discovery protocol for JGroups using AWS S3 buckets as cluster information store
http://jgroups.org
Apache License 2.0
14 stars 11 forks source link

jgroups-aws issue with Keycloak 25 and jgroups-aws 2.0.1-FINAL and 3.0.0-FINAL #348

Closed swc-hannes closed 3 months ago

swc-hannes commented 3 months ago

Hi,

we are usually running keycloak in FARGATE via jgroups-aws. in keycloak verison 25, they removed the cache stack option as a build parameter and now when trying to deploy via ENV vars the following errors arise.

2024-06-26 16:43:06,366 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: ISPN000541: Error while trying to create a channel using the specified configuration '[TCP(bundler.max_size=64000, sock_conn_timeout=300, linger=-1, thread_pool.keep_alive_time=60000, diag.enabled=false, bind_port=7800, thread_naming_pattern=pl, non_blocking_sends=false, thread_pool.thread_dumps_threshold=10000, send_buf_size=640k, thread_pool.max_threads=200, use_virtual_threads=false, bundler_type=transfer-queue, thread_pool.min_threads=0), RED(), aws.S3_PING(region_name=aws-region, num_discovery_runs=3, bucket_name=s3bucket-name), MERGE3(max_interval=30000, min_interval=10000), FD_SOCK2(offset=50000), FD_ALL3(), VERIFY_SUSPECT2(timeout=1000), pbcast.NAKACK2(xmit_interval=200, xmit_table_num_rows=50, resend_last_seqno=true, use_mcast_xmit=false, xmit_table_msgs_per_row=1024, xmit_table_max_compaction_time=30000), UNICAST3(conn_close_timeout=5000, xmit_interval=200, xmit_table_num_rows=50, xmit_table_msgs_per_row=1024, xmit_table_max_compaction_time=30000), pbcast.STABLE(desired_avg_gossip=5000, max_bytes=1M), pbcast.GMS(join_timeout=2000, print_local_addr=false), UFC(min_threshold=0.40, max_credits=4m), MFC(min_threshold=0.40, max_credits=4m), FRAG4(frag_size=60000)]'

followed by the folloowing line:

2024-06-26 16:45:32,153 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: JGRP000001: configuration error: the following properties in TCP are not recognized: {non_blocking_sends=false}

afterwards kc stops.

Thank you for any input. KR

rhusar commented 3 months ago

Which instructions did you follow? Clearly those need updating.

swc-hannes commented 3 months ago

Which instructions did you follow? Clearly those need updating.

For updating keycloak we removed --cache-stack=ec2 from kc.sh build ... and we introduced ENV KC_CACHE=ispn and ENV KC_CACHE_STACK=ec2.

For jgroups aws we use a bundle, I tried to increase the version from 2.0.1.Final to 3.0.0.Final.

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.group</groupId>
    <artifactId>s3-native-ping-bundle</artifactId>
    <version>25</version>

    <properties>
        <aws.sdk.version>1.12.410</aws.sdk.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-core</artifactId>
                <version>${aws.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-s3</artifactId>
                <version>${aws.sdk.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jgroups.aws</groupId>
            <artifactId>jgroups-aws</artifactId>
            <version>3.0.0.Final</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>copy-deps</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
swc-hannes commented 3 months ago

okay nevermind, i checked my old thread and saw that I branched away from the wrong branch... of course as last time, it was needed to exclude jgroups..

correct bundle:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.group</groupId>
    <artifactId>s3-native-ping-bundle</artifactId>
    <version>1</version>

    <properties>
        <aws.sdk.version>1.12.636</aws.sdk.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-core</artifactId>
                <version>${aws.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-s3</artifactId>
                <version>${aws.sdk.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jgroups.aws</groupId>
            <artifactId>jgroups-aws</artifactId>
            <version>3.0.0.Final</version>
            <exclusions>
                <!--
                    excluding jgroups because already
                    in keycloak
                 -->
                <exclusion>
                    <groupId>org.jgroups</groupId>
                    <artifactId>jgroups</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>copy-deps</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

thank you for the hint !

agseco commented 3 months ago

Thanks so much @swc-hannes for sharing your working config, I was facing the same issue. In case it helps others, I also had to exclude:

                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>

To prevent a dependency collision with SLF4J.

swc-hannes commented 3 months ago

credits to @rhusar though, as he informed me a yr ago about this issue. Thank you @agseco for pointing out slf4j either.