A "Communication breakdown with Bitbucket" error when cloning git repository via HTTPS from Bitbucket Data Center
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*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:
- When you do "git clone" over the HTTPS, does the transfer speed look limited?
- 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?
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 ...
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:
- "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. - "git clone" over SSH works without problem.
Data transfer over SSH may also be higher than over HTTPS. - When timing "git clone", it seems that communication breaks roughly after the same time - for example, after 1 minute, or after 5 minutes.
- 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.