Importing a repository from an external source fails due to java.net.ConnectException

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

Problem

When importing a repository into Bitbucket Server from existing Git projects hosted with Bitbucket Cloud, GitHub, GitHub Enterprise, or a standalone Git repository using the web interface, the import does not start and the following is displayed in the Bitbucket Server user interface:

1 Unable to reach server.

The following appears in the atlassian-bitbucket.log:

1 2 3 4 5 6 [httpclient-callbacks:thread-1] <username> XYS1Q7x561x9182x0 <id> <ip address> "POST /rest/importer/latest/external-source/missing-oauth-scopes HTTP/1.1" c.a.b.i.i.DefaultExternalRequestExecutor External request failed java.lang.RuntimeException: java.net.ConnectException at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-18.0.jar:na] ... java.net.ConnectException: null at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:170) ~[na:na]

Cause

An outbound proxy is configured for connecting to the externally hosted repository web site.

Resolution

Follow the steps on the configure an outbound HTTP and HTTPS proxy for Bitbucket Server page and restart Bitbucket Server.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.