Repositories are not visible under projects in Bitbucket server UI

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Repositories under projects are not visible in Bitbucket server UI. A blank page is displayed instead.

Repositories are accessible via the repository-specific url /projects/<PROJECT_KEY>/repos/<REPOSITORY_SLUG>/browse  or can be cloned using the git clone  command successfully.


Causes

Case 1

Certain version of Bitbucket 8.0+ are affected by the following bug, which causes the issue with repositories not being displayed under the Projects page:

BSERV-13577 - Getting issue details... STATUS


If you are on Bitbucket 8.0+ and using a version earlier than the fix versions listed in the bug ticket, you are likely affected.

Diagnosis

To confirm if it's due to the bug, perform the following:

  • Call the following API which retrieves repo data from the Search server

    curl -k -u <BITBUCKET_ADMIN_USER>:<PASSWORD> -X GET '<BITBUCKET_URL>/rest/search/latest/projects/<PROJECT_KEY>/repos?limit=500'


  • Call the following API which retrieves repo data from the database

    curl -k -u <BITBUCKET_ADMIN_USER>:<PASSWORD> -X GET '<BITBUCKET_URL>/rest/api/1.0/projects/<PROJECT_KEY>/repos?limit=500'


  • If the "missing" repo(s) that's not showing up in the Project list is not returned from the first API call from the search server but is present in the second API call from the database, it is due to search indexing issues.
    The repo(s) has not been added to the bitbucket-repository index.

  • You can also check if the repo has been added to the bitbucket-repository index by calling the following and checking if data is returned:

    curl -k -u <SEARCH_SERVER_USER>:<PASSWORD> -X GET <SEARCH_SERVER_URL>/bitbucket-repository/_doc/<REPO_ID>
    • SEARCH_SERVER_URL - URL of the search server instance (Elasticsearch or OpenSearch)
    • SEARCH_SERVER_USER
      • If you are using Elasticsearch, this is the auth.basic.username value in the buckler.yml file
      • If you are using OpenSearch, this is the user configured in the internal_users.yml  file. See remote OpenSearch server - security configuration for more info
    • PASSWORD
      • If you are using Elasticsearch, this is the auth.basic.password value in the buckler.yml file
      • If you are using OpenSearch, this is the password for the user configured in the internal_users.yml  file 
    • REPO_ID - internal ID of the repository. Please refer to Identifying a repository's ID in Bitbucket Server on how to get the repository ID


Case 2

This issue is caused by a corrupted index in the database.


Solutions

Case 1

Upgrade Bitbucket to one of the fix versions (or later versions) listed in the ticket, BSERV-13577 - Getting issue details... STATUS .

Case 2

Re-indexing the project  and repository  tables should fix the issue.  However, we recommend re-indexing the entire database by scheduling downtime for the database to be clean and consistent.

PostgreSQL:

 (info) Note: Running below commands does not need downtime. However, you may encounter a slight performance impact while the process is running. 

REINDEX TABLE project;
REINDEX TABLE repository;

(warning) To re-index the whole database, schedule downtime, shut down your Bitbucket server and run this query on the database:

REINDEX DATABASE <DATABASENAME>;

MySQL:  

(warning) Running below commands may require downtime. Please schedule downtime and run the query to re-index tables / database

ANALYZE TABLE project;
ANALYZE TABLE repository;

Repositories should be visible again after re-indexing has completed.


Last modified on Feb 8, 2023

Was this helpful?

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