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
Use the SSLPoke in Unable to Connect to SSL Services Due to 'PKIX Path Building Failed' Error to perform the following command:
1
java SSLPoke bitbucket.org 443
If it fail, run the following command:
1
/path/to/java/bin/keytool -list -v -keystore /path/to/java/jre/lib/security/cacerts > ca-list.txt
Compare it with the JDK in Oracle website
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
Shutdown Bamboo
Uninstall the JDK in the machine hosting Bamboo
Download and install JDK 8 from Oracle website
Make sure that
JAVA_HOME
environment variable is set to the installed JDKRestart Bamboo
Was this helpful?