Fail to create Bitbucket Cloud repository in Bamboo

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

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

Summary

Problem

Creating Bitbucket Cloud repository in Bamboo will have the following error:

1 Failed to load data from Bitbucket. [500 Internal Server Error]

The following appears in the atlassian-bamboo.log

1 2 3 4 5 6 7 8 9 10 2017-03-10 10:54:23,378 INFO [http-nio-8085-exec-7] [AccessLogFilter] username POST http://bamboo:8085/rest/hg/latest/bb/repositories/ 426572kb 2017-03-10 10:54:24,251 ERROR [http-nio-8085-exec-7] [ThrowableExceptionMapper] Uncaught exception thrown by REST service: 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 java.lang.RuntimeException: 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 at com.atlassian.bamboo.rest.utils.RESTCall.execute(RESTCall.java:197) at com.atlassian.bamboo.plugins.bitbucket.impl.BitbucketApiServiceImpl.getXmlResponseFromUrl(BitbucketApiServiceImpl.java:191) at com.atlassian.bamboo.plugins.bitbucket.impl.BitbucketApiServiceImpl.getRepositories(BitbucketApiServiceImpl.java:91) at com.atlassian.bamboo.plugins.bitbucket.rest.resource.BitbucketResource.lambda$getAvailableRepositories$0(BitbucketResource.java:85) at com.atlassian.bamboo.plugins.bitbucket.rest.resource.BitbucketResource.executeCall(BitbucketResource.java:313) at com.atlassian.bamboo.plugins.bitbucket.rest.resource.BitbucketResource.getAvailableRepositories(BitbucketResource.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Diagnosis

Diagnostic Steps

Cause

The existing cacerts file in the JDK installed in the machine hosting Bamboo, is missing the trusted CA certificate used by Bitbucket Cloud.

Solution

Resolution

  1. Shutdown Bamboo

  2. Uninstall the JDK in the machine hosting Bamboo

  3. Download and install JDK 8 from Oracle website

  4. Make sure that JAVA_HOME environment variable is set to the installed JDK

  5. Restart Bamboo

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.