Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Push to Bitbucket Repository – Connection Issues with No Response

Marvin Medeiros November 5, 2024

Hello everyone,

I’m experiencing a persistent issue when trying to push to my Bitbucket repository. Here’s what happens:

When I run the command:

bash
git push -v origin master

It only shows:

bash
Pushing to bitbucket.org:brazmix/exifdashboard.git

…and then nothing happens. The terminal remains stuck, and there’s no error message or timeout.

Steps I’ve Already Tried:

  1. Checked DNS and Network Settings:

    • I can resolve bitbucket.org with nslookup and get valid IP addresses (e.g., 104.192.142.24).
    • However, when I try to ping those IP addresses, there’s no response.
  2. Firewall and DNS Configuration:

    • I’ve disabled my local firewall (ufw) to ensure it’s not blocking anything.
    • I’ve updated /etc/resolv.conf to use Google DNS (8.8.8.8) and cleared the DNS cache.
  3. Testing Connection on Different Ports:

    • I tried connecting over port 443 for SSH by modifying the SSH config, but there’s still no response.
  4. VPN and Alternative Networks:

    • I attempted to connect using a VPN and another network (mobile data), but the issue persists.

Additional Information:

  • I’m using Ubuntu as my OS.
  • Other Git commands work locally, so it’s isolated to the connection with Bitbucket.

Has anyone encountered a similar issue or have any further suggestions on how I might resolve this? I appreciate any insights or advice you could provide!

Thank you!

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 7, 2024

Hey @Marvin Medeiros ,

and welcome to the Community!

The symptoms of the issue you reported strongly suggest a network issue or a firewall/proxy blocking the connection to Bitbucket's infrastructure.

Based on your description of the issue, I assume you're using SSH to interact with Bitbucket Cloud.

If that is the case, in order to further investigate this, I'd suggest the following steps:

1. Make sure that any firewall in place has bitbucket cloud IP's allowed

In case your machine is behind any firewall/proxy, make sure the Bitbucket Cloud IPs are allowed.

2. Test SSH connection with verbose logs

Try running the push again but with the ssh and git verbose flags enabled

GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git push

 You can also test the isolated SSH connection using the following command :

# Using the default SSH port 22

ssh -Tvvv bitbucket.org

# Using the altssh endpoint on port 443

ssh -Tvvv -p 443 altssh.bitbucket.org

You can then share the log output here in this post so we can analyze it. Just make sure to sanitize the logs and remove any sensitive information as community is a public forum.

3. Test with a different protocol (HTTPS)

To test is the issue is isolated to SSH only, try cloning/pushing the repository over HTTPS instead, using your username and app password for authentication.

 

I hope that helps! Should you have any questions, feel free to ask.

Thank you, @Marvin Medeiros !

Patrik S

Marvin Medeiros November 7, 2024

Hi, thanks for the reply. I also feel like its a network issue but i cant find out what is happening. I test running with verbose on, and this is what i got:


➜ html git:(master) GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git push origin master
15:50:04.017420 git.c:455 trace: built-in: git push origin master
15:50:04.018004 run-command.c:668 trace: run_command: unset GIT_PREFIX; 'ssh -vvv' git@bitbucket.org 'git-receive-pack '\''brazmix/exifdashboard.git'\'''
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/neo/.ssh/config
debug1: /home/neo/.ssh/config line 1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/neo/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/neo/.ssh/known_hosts2'
debug2: resolving "bitbucket.org" port 443
debug3: resolve_host: lookup bitbucket.org:443
debug3: ssh_connect_direct: entering
debug1: Connecting to bitbucket.org [2401:1d80:321c:1:0:bbc:1:df7c] port 443.
debug3: set_sock_tos: set socket 3 IPV6_TCLASS 0x10
debug1: connect to address 2401:1d80:321c:1:0:bbc:1:df7c port 443: Connection timed out
debug1: Connecting to bitbucket.org [2401:1d80:321c:2:0:bbc:1:df7c] port 443.
debug3: set_sock_tos: set socket 3 IPV6_TCLASS 0x10


Them i got stucked here

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 8, 2024

Hello @Marvin Medeiros ,

We can identify from the logs that your DNS is resolving to Bitbucket's IPv6. Maybe your ISP does not yet fully support IPv6.

Could you try forcing the use of IPv4 by adding the -4 flag in the git command?

GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git push -4 origin master

Also, I see you're trying to connect to port 443. The port 443 for SSH git operation is only available when using 

altssh.bitbucket.org

So you'd need to either return to port 22, or change the remote origin of your local repository to use altssh domain:

git remote set-url origin git@altssh.bitbucket.org:443/Workspace/repo_name/

Thank you, @Marvin Medeiros !

Patrik S

Marvin Medeiros November 9, 2024

Hi Patrik, now using the IPV4 git command i got a different error message, see the details below:



$ html git:(master) GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git push -4 origin master

17:41:37.188358 git.c:455 trace: built-in: git push -4 origin master
17:41:37.188989 run-command.c:668 trace: run_command: unset GIT_PREFIX; 'ssh -vvv' -4 git@bitbucket.org 'git-receive-pack '\''brazmix/exifdashboard.git'\'''
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/neo/.ssh/config
debug1: /home/neo/.ssh/config line 1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/neo/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/neo/.ssh/known_hosts2'
debug2: resolving "bitbucket.org" port 443
debug3: resolve_host: lookup bitbucket.org:443
debug3: ssh_connect_direct: entering
debug1: Connecting to bitbucket.org [104.192.142.26] port 443.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: Connection established.
debug1: identity file /home/neo/.ssh/id_rsa type 0
debug1: identity file /home/neo/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.10
kex_exchange_identification: banner line contains invalid characters
banner exchange: Connection to 104.192.142.26 port 443: invalid format
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2024

Hey @Marvin Medeiros ,

According to the log message, it seems you're still using the bitbucket.org domain for SSH, which only works for port 22 :

debug1: Connecting to bitbucket.org [104.192.142.26] port 443.

As you're trying with port 443, the domain is different and you need to update the local repository origin by running the following command inside your local clone of the repo:

git remote set-url origin git@altssh.bitbucket.org:443/Workspace/repo_name/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events