Invalid Version Format Error When Configuring Code Search

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 configuring Bitbucket Server Code Search, the test returns Connection attempt failed to establish connection. Check the Bitbucket log for details. and the follow error is present in bitbucket_search.log:

1 2 [2016-07-11 17:38:43,450][WARN ][com.atlassian.elasticsearch.buckler.SecureHttpServerTransport] [bitbucket_bundled] Caught exception while handling client http traffic, closing connection [id: 0xee988843, /127.0.0.1:36916 => /127.0.0.1:7992] java.lang.IllegalArgumentException: invalid version format: ￀

The following error appears in atlassian-bitbucket.log:

1 2 2016-07-12 02:36:34,475 INFO [I/O dispatcher 13] admin @18ELAMUx156x42x0 14g89mb 1.227.57.126 "POST /rest/search-admin/latest/test-connection HTTP/1.1" c.a.b.s.s.i.t.DefaultElasticsearchConnectionTester Testing connection with Elasticsearch failed due to exception java.util.concurrent.CompletionException: org.apache.http.ConnectionClosedException: Connection closed

Cause

The protocol being used to connect to Elasticsearch is incorrect. This is usually caused by having Bitbucket Server configured to use HTTPS to connect to Elasticsearch and Elasticsearch not being configured to support HTTPS.

For example, if the Elasticsearch URL is set to https://localhost:7992 this error will be encountered.

Resolution

Under Adminstration >> Server Settings >> Search change the Elasticsearch URL to http://localhost:7992

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.