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.
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.