A "Communication breakdown with Bitbucket" error when cloning git repository via HTTPS from Bitbucket Data Center

お困りですか?

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

コミュニティに質問

Platform Notice: Data Center - This article 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.

*Fisheye および Crucible は除く

要約

When cloning the GIT repository over HTTPS protocol takes significant time, in order of tens of seconds or minutes, the "git clone" command terminates with an error similar to the one shown below after some period of transferring data:

$ git clone https://your.bitbucket.server/some/path/your-repository.git

Cloning into 'your-repository'...
remote: Enumerating objects: ..., done.
remote: Counting objects: 100% (.../...), done.
remote: Compressing objects: 100% (.../...), done.
remote: Communication breakdown with Bitbucket

remote: aborting due to possible repository corruption on the remote side.
fatal: fetch-pack: invalid index-pack output

It may also happen that the data transfer speed when cloning the repository is relatively low.

This article explains how to confirm whether this is a reverse proxy issue.

環境

Bitbucket Server / Data Center 8.16.0, but also applicable to other versions.

診断

To find out what is behind this behavior, the first part is to gather more data from your setup:

  1. When you do "git clone" over the HTTPS, does the transfer speed look limited?
  2. Is this issue also happening when doing "git clone" over the SSH protocol? What is the data transfer speed when doing "git clone" over SSH?
  3. Get the timing information - after which period "git clone" stops with an error. Repeat cloning several times, and check if the period is roughly the same.
    You can use a simple command for this:

    # option 1
    date; git clone ... ; date
    
    
    # option 2
    time git clone ...
  4. Check if your Bitbucket Data Center uses a reverse proxy for HTTPS traffic.

Once we get this information, we can decide if this issue is related to the reverse proxy. 

We have an issue with the reverse proxy if these criteria are met:

  1. "git clone" over HTTPS seems limited.
    On the other hand, it is not strictly necessary that transfer speed is limited. Your case may be cloning of a huge GIT repository, the task that takes several minutes or tens of minutes to complete.
  2. "git clone" over SSH works without problem. 
    Data transfer over SSH may also be higher than over HTTPS.
  3. When timing "git clone", it seems that communication breaks roughly after the same time - for example, after 1 minute, or after 5 minutes.
  4. Your Bitbucket setup uses the reverse proxy.

原因

The cause of this issue, if the four criteria from the previous section are met, is the configuration of a reverse proxy.

If the four criteria mentioned above are not met, please contact Atlassian support to investigate your case.


Your reverse proxy may be configured with one or more of these options:

  • An HTTPS data transfer limit is applied, limiting transfer speed in KB/s or MB/s.
  • A general or per-IP address data transfer limit is applied to HTTPS or all proxied protocols.
  • There is a HTTPS connection timeout set with a small timeout value.
    This value is related and roughly equal to the time after which "git clone" quits with an error.

ソリューション

To solve this issue, edit your reverse proxy configuration:

  • Check, and increase HTTPS connection timeout value.
  • Check, and increase HTTPS data transfer limit.


最終更新日 2024 年 5 月 6 日

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

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