Error encountered creating link between Bitbucket Server and HipChat Server

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The error illustrated below occurs when trying to re-configure Bitbucket Server to HipChat Server integration.

1 2 Error encountered creating your hipchat link Something went wrong integrating Bitbucket and HipChat. We probably had trouble connecting to the HipChat server. Check that the connection between your server and HipChat is working correctly and try again.
(Auto-migrated image: description temporarily unavailable)

After clicking "Connect HipChat" from Bitbucket Server and you get re-directed to HipChat. Clicking the Install button from HipChat redirects you to the error shown above.

The following appears in the atlassian-bitbucket.log:

1 2015-11-05 16:00:00,000 WARN [http-nio-8080-exec-3] cs3gallery @FBIWLAx996x452x3 igxs9o 127.0.0.1 "POST /rest/hipchat/integration/latest/installation/complete HTTP/1.1" c.a.p.h.rest.HipChatLinkResource javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Diagnosis

  • Mostly experienced while trying to upgrade the HipChat integration from the Old API to the new and improved Oauth2 authentication method.

  • You may notice that you have to re-login again to Bitbucket Server after trying to integrate with HipChat.

Cause

  • For some reason Bitbucket server may have encountered a problem with creating the integration e.g. in one case, this may have failed due to a client side (browser specific) problem.

  • The problem could occur if the base URL configured in Bitbucket Server is not the same as the URL you use to log on to Bitbucket Server usually, this could trigger a XSRF exception (same reason you may need to re-login to Bitbucket server) which will also create this kind of error.

  • It could also be that you need to import the certificate from HipChat into the server where Bitbucket Server is running.

Workaround

  1. Try to remove the existing integration from the HipChat end.

    • If you're using HipChat cloud (hipchat.com), login to your HipChat admin

    • From the Integrations section (https://xxx.hipchat.com/admin/addons), remove the existing integrations with Bitbucket Server by clicking on the (...) icon in the far right of the Integration, and selecting uninstall.

    • From the API tab, click the delete icons on the far right of the token corresponding to your Bitbucket Server integration to remove it.

    • Try again from Bitbucket Server to "Connect HipChat"

  2. Try again with a different browser to rule-out client side issues.

  3. Follow this troubleshooting guide to import the SSL certificate: Unable to Connect to SSL Services Due to 'PKIX Path Building Failed' Error

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.