6

I have a problem with my git, when I pull or push to repository of bitbucket. I always get this error:

fatal: unable to access 'https://[email protected]/****/**': Failed to connect to bitbucket.org port 443: Connection timed out

I tried all solution but it can not resolved.

4
  • Did you try opening bitbucket in browser ? Commented Aug 28, 2018 at 4:51
  • Did you add bitbucket.org to your /etc/hosts file? If so, take it out. Commented Aug 28, 2018 at 17:48
  • @JimRedmond I tried that. Worked for the first time . Now the issue showed again Commented Aug 29, 2018 at 5:57
  • @KedarnagMukanahallipatna Yes. I can open open it in browser Commented Aug 29, 2018 at 5:58

8 Answers 8

11

UPDATE: 28-08-2020

This is Temp fix but at least working for me after bitbucket new IP changed

Note:- hosts file can be found in windows at C:\Windows\System32\drivers\etc and in Linux it exists at /etc/hosts. make sure you edit with admin rights i.e in windows open notepad as administrator and then open host file. In Linux sudo gedit /etc/hosts from the terminal from any location :)

just add the below line in hosts file

18.205.93.0 bitbucket.org

For all existing users who previously edited etc/hosts file and now stopped working just replace the old IP address of bitbucket with new one i.e in etc/hosts

REPLACE 104.192.143.3(old IP whatever) bitbucket.org

with

18.205.93.0 bitbucket.org

Happy Coding!

Sign up to request clarification or add additional context in comments.

2 Comments

Interestingly enough in 2021, Bitbucket started having issues for me recently, on the 104.x number that the nslookup (via even the internet sites) I can't get connected to. But the 18.205 number still works. So thank you, as having a working route/ip makes my life a lot simpler...
What if repo is hosted on azure dep ops
6

Recommendation 1: Just you need to remove your origin and set the origin again, then try to pull/push. Hopefully, it will work for you.

 git remote -v git remote remove origin git remote add origin https://[email protected]/softwarebd/mida-oss.git 

Recommendation 2: Remove those of lines from Windows/System32/drivers/etc/hosts file if anyone of these lines is available.

 104.192.143.1 bitbucket.org 104.192.143.2 bitbucket.org 18.205.93.0 bitbucket.org 

Recommendation 3: Change your network connection/provider. Sometimes your network provider causes this kind of issue.

Recommendation 4: Check firewall settings. Sometimes it was the issue for showing this kind of message.

4 Comments

It works, really a best answer.
What if repo is hosted on azure dep ops?
Recommendation 3 worked for me
Recommendation 1 worked for me
4

Try upgrading git if you have an old version.

Check your git version:

$ git --version 

For Debian-based Linux distros: run the following to upgrade:

sudo add-apt-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git 

Comments

0

Check if you require VPN and reconnect. That was the reason for me. After I reconnected to the VPN everything worked as normal.

Comments

0

In .git directory update file called config, remove this link. Post this do 'git pull', it'll ask for your credentials again & pull will successfully go through

reference to localhost

Comments

0

The problem was solved when I updated the Git version

1 Comment

Updating Git was already mentioned in this answer: stackoverflow.com/a/52089884/2745495
0

Removing bitbucket IP from host file and flushing of DNS worked for me , Follow these steps resolve the issue.

  1. Remove bitbucket ip from host file :
  • Open host file (C:\Windows\System32\drivers\etc) in Notepad as Administrator
  • Remove bitbucket IP from host file and save
  1. flush the DNS
    Open Command Prompt as an administrator and run:
    ipconfig /flushdns

Comments

-2

First, you are not pushing to GitHub, but BitBucket.

Second, since BitBucket status seems OK, there must be a network or proxy or firewall issue on your side.

Regarding the proxy specifically:

  • check your ~/gitconfig file content
  • remove any proxy line
  • set a proxy in your environment variables:

    export http_proxy=http://someuser:[email protected]:80 

3 Comments

"I tried all solution but it can not resolved.": what solution did you tried? What is your OS and Git version?
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
@Dev911 Thank you. I have edited the answer accordingly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.