Repository management shows error "Could not get repositories" in Bitbucket Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community

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

The repository management in Bitbucket Data Center shows the error "Could not get repositories" as shown in the screenshot below.



Environment

7.14.0+

Diagnosis


You will be seeing a connection refused error for GET /rest/search/latest/repository-management call in the atlassian-bitbucket.log.

DEBUG [http-nio-27140-exec-8] admin @1D0HM58x1214x55x0 1q32l3d 127.0.0.1 "GET /rest/search/latest/repository-management HTTP/1.1" c.a.b.i.s.search.rest.SearchResource Connection exception: Connection refused

Cause

The repository management functionality makes use of the Search component (The process that is responsible for the code search in Bitbucket). So any issue with bitbucket-elasticsearch connectivity could affect displaying the repository list in the repository management screen.

There could be multiple reasons why Bitbucket is not able to connect to Elasticsearch

  1. Bitbucket could have started as root user.
  2. The elastic search process could have been killed by some external entity like an OOM killer.

Solution

  1. Run Bitbucket Server with a dedicated user
  2. Run the below command to check if Search is actually running on your server

    ps -ef | grep -i search

    If it's not running, please manually stop and start Bitbucket using the ./start-bitbucket.sh script inside the bin folder of the installation directory.

  3. If the search is still not starting or not connecting with Bitbucket, please create a support request with the output of .start-bitbucket.sh script execution.


Last modified on Apr 18, 2024

Was this helpful?

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