Fail to create Bitbucket Cloud repository in Bamboo

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

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

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

The following appears in the atlassian-bamboo.log

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.

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
Last modified on Mar 15, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.