Searching Bitbucket Data Center fails with: Search is currently unavailable Refresh the page and try again

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

Summary

Searching Bitbucket Data Center or Bitbucket Server fails with the following message in web interface:

Search is currently unavailable Refresh the page and try again

(Auto-migrated image: description temporarily unavailable)

Environment

This issue has been reproduced in Bitbucket version 7.21.9 and 8.9.0, but other versions may also be affected.

Diagnosis

  • In Bitbucket's web interface, under Administration > Server Settings, clicking Test button in the Search section results with error:

    Access to the search server was denied. Check your settings.

    (Auto-migrated image: description temporarily unavailable)
  • Executing a curl command, with the correct credentials and URL of Elasticsearch, returns error 401, eg.

    cUrl test

    1 2 $ curl -u <ES_User>:<ES_Password> https://<Elasticsearch_URL>:9200 {"error":"unknown","status":401}

Cause

The account used by Elasticsearch with Buckler plugin has been locked because of too many failed attempts to authenticate.

Solution

  • Check if a script or another automated process, that repeatedly sends requests directly to Bitbucket's Elasticsearch with incorrect credentials.

    Stop that script or process, or configure the firewall so that only Bitbucket nodes can send queries to Elasticsearch.

  • Allow Elasticsearch to run for at least 5 minutes without receiving any requests.

    This may require either stopping Bitbucket, or temporarily isolating it from Elasticsearch, using the firewall or /etc/hosts file on each node.

  • After 5 minutes without receiving any requests, Elasticsearch should reset its account and the configured credentials should start working again:

    • The curl command should return the correct response, including the cluster_name, Elasticsearch version information etc. - eg.

      cUrl test

      1 2 3 4 5 6 7 8 9 10 11 12 13 14 $ curl -u <ES_User>:<ES_Password> https://<Elasticsearch_URL>:9200 { "name" : "uaz3Vt6", "cluster_name" : "elasticsearch", "cluster_uuid" : "QuvwbzFeRPGSTuIc4FnoLg", "version" : { "number" : "5.5.3", "build_hash" : "9305a5e", "build_date" : "2017-09-07T15:56:59.599Z", "build_snapshot" : false, "lucene_version" : "6.6.0" }, "tagline" : "You Know, for Search" }
    • On the Server Settings page, the Test button should return success

    • In Bitbucket's web interface, the search function should work again

Updated on March 20, 2025

Still need help?

The Atlassian Community is here for you.