Bitbucket Cloud complains "Network is down" and cannot operate commands via ssh

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Problem

When you try to operate git/mercurial commands (such as git-clone, git-pull, git-fetch or git-push, etc), Bitbucket responses the error like below even if the repository exists and doesn't have any problem in access rights:

1 2 3 4 5 6 7 $ git clone git@bitbucket.org:<username>/<repository_name>.git Cloning into '<repository_name>'... ssh: connect to host bitbucket.org port 22: Network is down fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Diagnosis

Diagnostic Steps

Perform the SSH command below:

1 ssh -vvvT git@bitbucket.org

The expected output includes 2 messages below:

  • the debug message mentioning "IP_TOS" like as below:

    1 [203.0.113.0]:22 (debug3: ssh_packet_set_tos: set IP_TOS 0x08)
  • the message telling you could successfully log in:

    1 logged in as <username>.

Otherwise, you can determine the ssh connection may use unsupported protocol, specifically, IPv6. For example, the unexpected output looks like below:

1 2 3 4 5 6 7 debug1: Reading configuration data /Users/<username>/.ssh/config debug1: /Users/<username>/.ssh/config line 241: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to bitbucket.org port 22. ssh: connect to host bitbucket.org port 22: Network is down

Cause

You may have an issue connecting with IPV6. Here are the commands to test. This is the expected output if IPv6 is not working:

1 2 3 ssh -6Tv git@bitbucket.org ... ssh: connect to host bitbucket.org port 22: Network is down

This command forces IPv4.

1 2 3 4 $ ssh -4T git@bitbucket.org logged in as <username>. You can use git or hg to connect to Bitbucket. Shell access is disabled.

If IPv4 works please continue to the workarounds. If IPv4 does not work, the problem described here is not your issue.

Solution

Workaround

Define ssh command

Temporarily define the ssh command.

1 GIT_SSH_COMMAND="ssh -4" git clone git@bitbucket.org:<username>/<repository_name>.git

Edit .ssh config

Edit SSHD configuration file (such as ~/.ssh/config) to enforce IPv4 connection:

~/.ssh/config

1 2 Host bitbucket.org AddressFamily inet

Resolution

IPv6 seems to not be configured correctly on your network. Please advise your network admin of this issue.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.