git 无法连接到 bitbucket.org 端口 443:网络无法访问
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38606443/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failed to connect to bitbucket.org port 443: Network is unreachable
提问by AmanKumar
I am getting issue while pushing code.
我在推送代码时遇到问题。
git push origin master
fatal: unable to access 'https://[email protected]/xxxxxx/xxxxxx.git/':
Failed to connect to bitbucket.org port 443: Network is unreachable
How to avoid that error message?
如何避免该错误消息?
回答by VonC
TLDR; Try first git push -4 origin master
TLDR;先试试git push -4 origin master
There are issues reporting current problems to access bitbucket through https (issue 13060, issue 12184)
有问题报告了通过 https 访问 bitbucket 的当前问题(问题 13060,问题12184)
The usual answer is:
通常的答案是:
"Failed to connect" errors could be anything from DNS issues to local network problems to ISPs that are incompletely routing Bitbucket traffic. Unfortunately, there isn't enough detail in any of these comments to diagnose the exact problems, which may or may not be related to each other. If you could, please open a support ticket with the results of the following commands:
For OS X, Linux, and other UNIX-based operating systems:
“无法连接”错误可能是从 DNS 问题到本地网络问题,再到不完整路由 Bitbucket 流量的 ISP。不幸的是,这些评论中的任何一个都没有足够的细节来诊断确切的问题,这些问题可能彼此相关,也可能不相关。如果可以,请使用以下命令的结果打开支持票:
对于 OS X、Linux 和其他基于 UNIX 的操作系统:
ping -c10 bitbucket.org
ping6 -c10 bitbucket.org
traceroute bitbucket.org
traceroute6 bitbucket.org
GIT_CURL_VERBOSE=1 git ls-remote https://bitbucket.org/bitbucket/do_not_delete
For Windows:
对于 Windows:
ping -n 10 bitbucket.org
ping -n 10 -6 bitbucket.org
tracert bitbucket.org
tracert -6 bitbucket.org
(To clarify: "
ping6
" and "traceroute6
" are the IPv6 equivalents of "ping
" and "traceroute
", respectively, and "GIT_CURL_VERBOSE=1
" before anygit
command will detail all the HTTP-specific parts of the connection.
On the Windows side of things, the "-6
" in the command line specifies that your computer should use IPv6 for the ping ortracert
.)Additionally, if you suspect that your problem is related to Bitbucket's IPv6 support, then you should be able to test your overall IPv6 connectivity by opening the following links in your browser:
(为了澄清:“
ping6
”和“traceroute6
”是的“IPv6的等同物ping
”和“traceroute
”,分别与“GIT_CURL_VERBOSE=1
”之前的任何git
命令将详细介绍的所有连接的HTTP特定部分。
对事物的视窗侧,将“-6
”在命令行中指定您的计算机应使用 IPv6 进行 ping 或tracert
.)此外,如果您怀疑您的问题与 Bitbucket 的 IPv6 支持有关,那么您应该能够通过在浏览器中打开以下链接来测试您的整体 IPv6 连接性:
https://ipv6.google.com
https://www.v6.facebook.com
Those links should not work at all if your IPv6 connection is disabled or misconfigured.
如果您的 IPv6 连接被禁用或配置错误,这些链接将根本无法工作。
More generally, check your /etc/hosts for any entry regarding bitbucket.org.
See "What are the Bitbucket Cloud IP addresses I should use to configure my corporate firewall?"
更一般地,检查您的 /etc/hosts 是否有关于 bitbucket.org 的任何条目。
请参阅“我应该使用哪些 Bitbucket Cloud IP 地址来配置我的公司防火墙?”
The IP address has recently changed:
IP 地址最近发生了变化:
Since July 28, 2018: IPv4 inbound for bitbucket.org, api.bitbucket.org, and altssh.bitbucket.org
18.205.93.0/25 18.234.32.128/25 13.52.5.0/25
自 2018 年 7 月 28 日起:bitbucket.org、api.bitbucket.org 和 altssh.bitbucket.org 的 IPv4 入站
18.205.93.0/25 18.234.32.128/25 13.52.5.0/25
Keep in mind ping
might be blocked, triggering the same error message.
请记住ping
可能会被阻止,触发相同的错误消息。
The IPV6 can be problematic: the same thread advises:
IPV6 可能有问题:同一线程建议:
This is probably coming when git is trying to push over IPV6. I'm not exactly sure why getting this error with IPV6. But here are different solutions, that you can use to fix this problem.
Add any one of the following IP into /etc/hosts file to force git to use IPV4
当 git 试图推动 IPV6 时,这可能会发生。我不确定为什么在使用 IPV6 时会出现此错误。但是这里有不同的解决方案,您可以使用它们来解决这个问题。
将以下任一IP添加到/etc/hosts文件中,强制git使用IPV4
104.192.143.2
104.192.143.3
104.192.143.1
That is,
那是,
104.192.143.2 bitbucket.org
To
/etc/hosts file
(Or)
Upgrade your git to latest version. Probably this could solve the problem else use the following option when you push after you upgrade git (this feature was added newly to git)
到
/etc/hosts file
(或者)
将您的 git 升级到最新版本。可能这可以解决问题,否则在升级 git 后推送时使用以下选项(此功能是新添加到 git 的)
-4, --ipv4 use IPv4 addresses only
That is ,
那是 ,
git push -4 bitbucket dev
You can specify this option
-4
while you push, pull or clone.(Or)
You may configure git to use http proxy to solve this problem
您可以
-4
在推送、拉取或克隆时指定此选项。(或者)
你可以配置git使用http代理来解决这个问题
git config --local http.proxy http://proxyuser:[email protected]:8080
If you are already using latest version of git, you can simply use option
-4
to force git to use IPV4 address or you can go with/etc/hosts
If you wanna see debug message while pushing or pulling code you can set following environment variable before you do so,
如果您已经在使用最新版本的 git,您可以简单地使用选项
-4
来强制 git 使用 IPV4 地址,或者您可以使用/etc/hosts
如果您想在推送或拉取代码时看到调试消息,您可以在执行此操作之前设置以下环境变量,
export GIT_CURL_VERBOSE=1
回答by monjer
回答by ganesh
this is crazy ,after removing 104.192.143.2 bitbucket.org
from /etc/hosts
it started working for me
这太疯狂了,104.192.143.2 bitbucket.org
从/etc/hosts
它移除后开始对我来说有效
回答by badarshahzad
I have removed 104.192.143.2 bitbucket.org
from this path /etc/hosts
. It start working.
我已经104.192.143.2 bitbucket.org
从这条路径中删除了/etc/hosts
。它开始工作。
Edit:I again faced error of Failed to connect to bitbucket.org port 443: Network is unreachable
.
编辑:我再次面临Failed to connect to bitbucket.org port 443: Network is unreachable
.
I added new ip 18.205.93.0 bitbucket.org
and it is working perfectly. You can find ip simply typing this command ping -c10 bitbucket.org
.
我添加了新 ip 18.205.93.0 bitbucket.org
,它运行良好。您只需键入此命令即可找到 ip ping -c10 bitbucket.org
。
Referance: For more information visit this link
回答by aronbo
Just add an entry to your ~/.ssh/config as follows:
只需在您的 ~/.ssh/config 中添加一个条目,如下所示:
Host bitbucket.org
AddressFamily inet
回答by KalenGi
Check firewall settings. This was the issue in my case.
检查防火墙设置。这就是我的问题。
回答by Nikhil Kumar
I got this resolved. One of the reasons it happens is due to your system being on proxy network. In that case you have to run below command :
我解决了这个问题。它发生的原因之一是由于您的系统在代理网络上。在这种情况下,您必须运行以下命令:
$ git config --global http.proxy http://username:password@proxy:port
$ git config --global http.proxy http://username:password@proxy:port
where, username : your system userID| password : system password | proxy : Ip address of the proxy you are using | port : Of that proxy|
其中,用户名:您的系统用户 ID| 密码:系统密码| proxy : 您正在使用的代理的 IP 地址 | 端口:那个代理的|
This was hapenning due to network limitation of my organization network.
这是由于我的组织网络的网络限制而发生的。
回答by Rameswar Tarai
switch the network provider. Some times your network provider causes this kind of issue.
切换网络提供商。有时您的网络提供商会导致此类问题。
回答by Nabin Rawat
For windows open your command prompt and do:
对于 Windows,打开命令提示符并执行以下操作:
- ping -n 10 bitbucket.org
- tracert bitbucket.org
- ping -n 10 bitbucket.org
- tracert bitbucket.org
This will definitely gone a solve it. It works on mine.
这肯定会解决它。它适用于我的。
回答by user3470929
so i was having the same problem where neither i was able to load bitbucket in browser or push pull clone bitbucket from terminal
i followed discussion.
where in my hosts file had 104.192.143.3 bitbucket.org
which was added when i used bit bucket for first time for another project .
所以我遇到了同样的问题,我既无法在浏览器中加载 bitbucket,也无法从终端推拉克隆 bitbucket 我跟着讨论。104.192.143.3 bitbucket.org
当我第一次将位桶用于另一个项目时,在我的主机文件中添加了哪些内容。
so thought of removing it from hosts file , it started working again its bit strange community has to come up with the reason for this
所以想从主机文件中删除它,它又开始工作了,它有点奇怪的社区不得不想出这个原因