Connection refused error upon running GIT SSH operations after migrating or upgrading Bitbucket
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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.
*Except Fisheye and Crucible
After upgrading and/or migrating Bitbucket, users cannot do GIT SSH operations (clone, push, etc) against Bitbucket.
- Bitbucket 7+
- A reverse proxy in front of Bitbucket.
The issue occurs for all users that use SSH. When connecting from another server a message that the connection is refused is thrown:
Connecting to bitbucketserver.com [192.168.1.2] port 7999.debug3: set_sock_tos: set socket 3 IP_TOS 0x48debug1: connect to address 192.168.1.2 port 7999: Connection refusedssh: connect to host bitbucketserver.com port 7999: Connection refusedfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.''
You may check the connection between the machine in which you are trying to GIT SSH and Bitbucket's server by running from the client machine:
telnet bitbucketserver.com 7999
The telnet tests the ability of the client to communicate with the Bitbucket server on the correct port and the output should be something like:
Connected to <bitbucket_ssh_address>.
Escape character is '^]'.
An intermediary element such as a firewall is blocking the requests to the Bitbucket host server since that traffic is not allowed to that hostname/port from the client machine.
Consult your system admin/network team to ensure that communications out to Bitbcuket's IP/port are allowed and that there is no kind of networking/firewall-level block preventing traffic from going between Bitbucket and your client.