Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to connect to the primary server.

Ganesh Bhise March 4, 2018

I have setup bitbucket data-center on my local virtual machine using HAProxy.
URL : https://192.***.**.51 ( not hosted yet )

This instance running properly under haproxy.

Now when I try to setup smart mirroring( for that setup new mirror instance on other virtual machine URL= https://192.***.**.52 ) .

In the setup section when I try to add Primary server URL = https://192.***.**.51 and click on submit configuration.

It's giving me error that Unable to connect to the primary server. 

So can you please help me if I am missing something.

3 answers

0 votes
Hrudu Shibu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2025

To resolve the issue of "Unable to connect to the primary server" when setting up smart mirroring in Bitbucket Data Center, consider the following troubleshooting steps:

Check Network Connectivity: Ensure that both the primary server and the mirror server are running and connected to the network. You can verify this by pinging each server from the other to confirm they can communicate.

Firewall and Network Configuration: Verify that there are no firewalls or network devices blocking the connection between the primary server and the mirror. Both incoming and outgoing connections need to be allowed for the specific ports used by Bitbucket.

Protocol and Port Configuration: Ensure that the correct protocol (HTTPS) and ports are configured in the bitbucket.properties file for both the primary and mirror servers. The configuration should include:

server.port=7990

server.proxy-name=<your-domain>

server.secure=true

server.scheme=https

server.proxy-port=443

SSL Configuration: Check that the SSL certificates are correctly configured and valid. The certificate's common name (CN) must match the host name, and it should be installed in the correct Java trust store.

Mirror Base URL: Ensure that the mirror base URL is correctly set. If it was set incorrectly during the initial setup, you might need to delete the mirror and set it up again.

Logs and Error Messages: Review the logs on both the primary and mirror servers for any error messages that might provide more insight into the connection issue.

For more detailed troubleshooting, you can refer to the https://confluence.atlassian.com/bitbucketserver/troubleshoot-bitbucket-smart-mirroring-776640367.html

0 votes
Ganesh Bhise March 5, 2018
  • Enabled SSH on the primary server? -> Yes enable SSH on primary server.
  • Installed/setup an SSH client on the mirror? -> Yes
  • Installed a valid SSL (signed by CA) on the primary server and mirror?-> Yes installed both URL running using https://192.***.***.51/52

    In log on mirror node I am getting following error:
  • Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
    ... 17 common frames omitted
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
    ... 23 common frames omitted
0 votes
Alyss
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 5, 2018

Hey Ganesh,

Have you:

  • Enabled SSH on the primary server?
  • Installed/setup an SSH client on the mirror?
  • Installed a valid SSL (signed by CA) on the primary server and mirror?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events