Bitbucket cluster authentication failed due to hazelcast.group.name and hazelcast.group.password
Asked by Andrew Yu:

Setup two nodes in AWS EC2 to form clustering. An error is appeared:  

com.atlassian.stash.internal.cluster.NodeConnectionException: Cluster authentication failed. **Please make sure all members share the same value for 'hazelcast.group.name' and 'hazelcast.group.password' in bitbucket.properties.**  
at com.atlassian.stash.internal.cluster.DefaultClusterJoinManager.accept(DefaultClusterJoinManager.java:102)  
at com.atlassian.stash.internal.hazelcast.ClusterJoinSocketInterceptor.onAccept(ClusterJoinSocketInterceptor.java:49)  
at com.hazelcast.nio.NodeIOService.interceptSocket(NodeIOService.java:300)  
at com.hazelcast.nio.tcp.TcpIpAcceptor$AcceptorIOThread.configureAndAssignSocket(TcpIpAcceptor.java:316)  
at com.hazelcast.nio.tcp.TcpIpAcceptor$AcceptorIOThread.access$1400(TcpIpAcceptor.java:138)  
at com.hazelcast.nio.tcp.TcpIpAcceptor$AcceptorIOThread$1.run(TcpIpAcceptor.java:305)  
at com.hazelcast.util.executor.CachedExecutorServiceDelegate$Worker.run(CachedExecutorServiceDelegate.java:227)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  
at java.base/java.lang.Thread.run(Thread.java:829)  
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)  
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)

... 1 frame trimmed

My bitbucket.properties in the bitbucket shared folder is

server.port=8444  
server.ssl.enabled=true  
server.ssl.key-store-type=pkcs12  
server.ssl.key-store=/etc/atlassian/bitbucket/tls.p12  
server.ssl.key-store-password=password  
server.ssl.key-password=password  
server.ssl.protocols=TLSv1.3  
server.ssl.key-alias=bitbucket  
hazelcast.network.multicast=false  
hazelcast.network.tcpip=true  
hazelcast.port=5701  
hazelcast.group.name=bitbucket-cluster  
hazelcast.group.password=password  
hazelcast.network.tcpip.members=\<node1_ip_address\>:5701,\<node2_ip_address\>:5701

The bitbucket is setup by docker in ansible:  
- name: Start bitbucket container  
docker_container:  
name: "{{ bitbucket_container_name }}"  
image: "{{ bitbucket_docker_image }}:{{ docker_images.bitbucket.tag }}"  
state: started  
restart_policy: unless-stopped  
container_default_behavior: compatibility  
volumes:  
- "{{ bitbucket_shared_host_location }}:{{ bitbucket_shared_home }}/"  
- "{{ bitbucket_private_host_location }}:{{ bitbucket_home }}/"  
- "/etc/atlassian/bitbucket/tls.p12:/etc/atlassian/bitbucket/tls.p12"  
detach: true  
network_mode: default  
published_ports:  
- 5701:5701  
- "{{ bitbucket_https_port }}:8444"  
env:  
{  
"JDBC_DRIVER": "org.postgresql.Driver",  
"JDBC_URL": "jdbc:postgresql://{{ bitbucket_postgresql_host }}:{{ bitbucket_postgresql_nodeport }}/{{ bitbucket_postgresql_database }}",  
"JDBC_USER": "{{ bitbucket_postgresql_user }}",  
"JDBC_PASSWORD": "{{ bitbucket_postgresql_password }}",  
"JAVA_OPTS": "-Dcluster.node.name={{ inventory_hostname }} -Duser.timezone=Etc/GMT+0 -Dhazelcast.local.publicAddress={{ ansible_default_ipv4.address }}:5701",  
}  
security_opts:  
- "label:disable"

Can anyone please shed some lights on?


Answers:
author: Andrew Yu
body: ??

comments: author: Andrew Yu
body: I solved the issue in the end. That is because the group name and password are verified before any other checks. By adding a line in

bitbucket.properties  
\`\`\`  
hazelcast.node.authentication.enabled=false  
\`\`\`  
The default value of the attribute above is true.

I don't know how/why does it work. But this line resolves the issue. I post the solution just in case someone encounter the similar issue.


author: Kevin Wang
body: Thanks Andrew, nice notice here, I met the similar issue and resolved based on your solution! Appreciate\~


Tags: bitbucket-server

server