无法连接到 bitbucket.org 端口 443:没有到主机的路由

Failed to connect to bitbucket.org port 443: No route to host

我收到错误消息,因为 无法连接到 bitbucket.org 端口 443:没有到主机的路由 当我尝试拉或推时。 相同的存储库可用于在我们的网络之外进行拉动。 可能是什么问题,因为它工作正常。

我也遇到了同样的问题。

我尝试通过 ppa 更新 git,重置。gitconfig,我检查了 github repo 正在克隆但不是 bitbucket,我取消设置 http 和 https 代理,重新启动我的网络服务(在终端输入 - 'my network services'),改变了我的笔记本电脑连接的网络。但是 none 这对我有用。

修复了它,方法是将下面一行添加到hosts(/etc/hosts) 文件

104.192.143.2 bitbucket.org

我没有尝试过的另一个解决方案是 -

使用代理进行克隆git,通过代理使用 ssh 连接到 Bitbucket。

此解决方案也适用于以下错误:

Failed to connect to bitbucket.org port 443: Network is unreachable

只需重新启动您的网络连接。在 ubuntu linux 中:sudo 服务 network-manager 重新启动。通过 ping 一些已知网站来检查您现在是否已连接到互联网,例如:ping yahoo.com 或 bitbucket.org

我尝试用服务器的 ip 替换 bitbucket.org 即 104.192.143.2 在 repo 的来源 url 中, git@bitbucket.org:xyz/xyz.git 到 git@104.192.143.2:xyz/xyz.git 这在 plesk server

上克隆 repo 时有效

更新:28-08-2018

这是 Temp 修复,但至少在 bitbucket 新 IP 之后对我有用

注意:- hosts 文件可以在 C:\Windows\System32\drivers\etc 的 windows 中找到,在 Linux 中它存在于 /etc/hosts。确保您使用管理员权限进行编辑,即在 windows 中以管理员身份打开记事本,然后打开主机文件。在 linux sudo gedit /etc/hosts 来自任何位置的终端 :)

对于之前编辑过 etc/hosts 文件但现在停止工作的所有新用户或现有用户,只需将 bitbucket 的旧 IP 地址替换为新地址即可,即 etc/hosts

替换 104.192.143.3 bitbucket.org

18.205.93.0 bitbucket.org

谢谢

建议1:把你的原点去掉,重新设置原点,再试试push/pull。希望它能奏效。

 git remote -v
 git remote remove origin
 git remote add origin https://habibbd@bitbucket.org/ocplbd/bida-oss.git 

建议 2: 如果其中任何一行可用,则从 Windows/System32/drivers/etc/hosts 中删除这些行。

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

建议三:更换网络connection/provider。有时您的网络提供商会导致此类问题。

建议 4:检查防火墙设置。有时是显示这种错误的问题。