When attempting to execute a git push operation, the process fails and returns the error message 'Could not read from remote repository' on Bitbucket Data Center

お困りですか?

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

コミュニティに質問


プラットフォームについて: 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 は除く

要約

While attempting to execute the git push operation, SSH connections are getting dropped with the "Could not read from remote repository" error message.

環境

Applied to Bitbucket Data Center 7.10.0
Applies to Bitbucket Data Center 7.x and 8.x

診断

Enabled Git client debugging to get more details using the below steps:

For HTTP/HTTPS URL:
On Linux:

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

On Windows:

set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
For SSH URL:

a. Set the following variable for the ssh debug log: GIT_SSH_COMMAND="ssh -vvv" 
b. Replicate the issue for example: git clone ssh://git@<bitbucket URL>:<bitbucket port>/<project key>/<repository slug>.git


原因

This issue generally occurs when the SSH connection is closed by remote host.
The git client debug output below indicates that the connection for git push operation is closed by the Remote Host and it has been closed on port 22.

ここをクリックして展開...

C:\projects\ >git push
OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
debug1: Reading configuration data /c/Users/Pxxxxxxx/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to xxxxxxxxxxxxx [xx.xx.x.xx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_rsa type 0
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_dsa type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ed25519 type 3
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_xmss type -1
debug1: identity file /c/Users/Pxxxxxx/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.8
kex_exchange_identification: Connection closed by remote host
Connection closed by xx.xx.x.xx port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.


Typically, connectivity is expected to occur through port 7999 for SSH connections. However, specifying port 22 suggests that a Load Balancer has been set up for the Bitbucket environment. Under this configuration, requests from the git client should initially reach the Load Balancer on port 22, and then be redirected to port 7999. The observed issue, where the connection is prematurely closed on port 22, indicates that the rejection is occurring at the Load Balancer level rather than being an issue directly related to the Bitbucket server.

ソリューション

The issue should be resolved after modifying the configuration setting at the Load Balancer end for the port redirection.


最終更新日 2024 年 5 月 23 日

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

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