Bitbucket - DataStoreException: A database error has occurred - index contains unexpected zero page at block

お困りですか?

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

コミュニティに質問


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

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.

*Fisheye および Crucible は除く

要約

An operation fails (perhaps in the UI) and the following (or something similar) is seen in the logs:

XXXX-XX-XX XX:XX:XX,XXX ERROR [http-nio-7990-exec-74] X555555 *<request_ID> <user> <ip>,<ip> "POST /projects/<proj>/repos/<repo>/pull-requests HTTP/1.1" c.a.s.i.w.pull.PullRequestController Exception occurred
   com.atlassian.bitbucket.DataStoreException: A database error has occurred.
   ...
   Caused by: java.sql.BatchUpdateException: Batch entry 7 insert into bb_pr_commit (commit_id, pr_id) values ('<hash>', <value>) was aborted: ERROR: index "idx_bb_pr_commit_commit_id" contains unexpected zero page at block <block_num>
     Hint: Please REINDEX it.  Call getNextException to see other errors in the batch.


環境

Postgres



原因

Index has become corrupt in Postgres DB.

ソリューション

  • Implement a maintenance window
  • Perform full backup of database for safety
  • Shutdown any application connected to the database
  • Reindex the index as the Postgres database hints
  • Start applications and ensure the issue has been resolved


In this case it is best to confer with a DBA but the actual SQL used thus far (and in the case of the example above):

REINDEX INDEX idx_bb_pr_commit_commit_id;

最終更新日 2022 年 8 月 10 日

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

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