"There is no repository with short description '<repo-slug>' in '<project-key>' project" error on Bitbucket Datacenter

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

While trying to access a repository on the Bitbucket UI, we see this message: "There is no repository with short description '<repo-slug>' in '<project-key>' project"

環境

Bitbucket Server/Datacenter
PostgreSQL Database

診断

On the Bitbucket Server, certain OS-level upgrades can cause the upgrade of the glibc version which might trigger a change in the sorting logic of the Bitbucket Database and can cause an issue with the existing Database indexes. 

  • Check if the repository exists on the filesystem. If yes, it means that there could be an issue with the Bitbucket Database because all the projects and relationships between them and the repositories are stored there.
  • The issue might be caused because of an upgrade of glibc, which triggered a change in the sorting logic of PostgreSQL and caused the issue with existing indexes. If that is the case, you need to connect to the database and rebuild all the indexes.

原因

As all the projects and relationships between them and the repositories are stored in the Bitbucket Database, corruption in the Database index will cause the repository/ projects to be shown as missing even though they are present on the Bitbucket filesystem.

ソリューション

注意

Under any circumstances, please do not delete the data while the application is up and running and please ensure to have a consistent backup of the File system and Database before making any changes in the Database

There are two approaches to solve this:

Approach 1:

  • Restore the database to the pre-upgrade state
  • Reindex the entire Bitbucket database


Approach 2:

If the approach above is not an option, you need to remove the duplication manually and then reindex:

  • Identify if there are more duplicates:

    SELECT slug, project_id, COUNT(*)
    FROM repository
    GROUP BY slug, project_id
    HAVING COUNT(*) > 1;
  • Delete one of the duplicates
  • Reindex the entire database

    REINDEX DATABASE <DATABASENAME>;

    If multiple tables have duplicates, repeat the procedure for each until the full reindex is successful.



最終更新日: 2024 年 2 月 12 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.