Bundled Elasticsearch throws node validation exception after Bitbucket upgrade
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
After upgrading Bitbucket, the bundled Elasticsearch instance fails to start. In addition, the following error is found in the <BitbucketHome>/log/search/bitbucket_search.log
file:
1
2
[2020-02-24T06:15:46,142][ERROR][o.e.b.Bootstrap ] [bitbucket_bundled]node validation exception
Cluster name [bitbucket_search] subdirectory exists in data paths [<BITBUCKET_HOME>/shared/search/data/bitbucket_search]. All data under these paths must be moved up one directory to paths [<BITBUCKET_HOME>/shared/search/data]
Cause
This bitbucket_search
directory may exist because an older Bitbucket version (Bitbucket 5.4.x or less) used the following path to store the Elasticsearch indexes:
$BITBUCKET_HOME/shared/search/data/bitbucket_search/nodes
From Bitbucket 5.15.x onward, it stores the Elasticsearch indexes in the following path:
$BITBUCKET_HOME/shared/search/data/nodes
In the following ticket, we upgraded the version of the bundled Elasticsearch instance to 6.8.6 - which contains a change from Elasticsearch which prevents the node from starting up if there's a cluster name in the provided data path:
Resolution
The following bug ticket tracks our progress towards automatically applying the below steps in later versions of Bitbucket:
To resolve this problem, the older $BITBUCKET_HOME/shared/search/data/bitbucket_search
directory needs to be fully removed.
Once this directory has been removed, run the appropriate Bitbucket start-up script for your environment in order to attempt to start the bundled Elasticsearch instance.
This should not have any impact on the integrity of the indexes stored in $BITBUCKET_HOME/shared/search/data/nodes
, which is the current location where the bundled Elasticsearch instance stores its indexes.
Was this helpful?