fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle解决版本
现象
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out
根本原因
repo工具是一个python脚本,里面有个方法_InitHttp,检测到http_proxy在环境变量中就会用他,如果环境变量是一个无效的,那么就会报错。所以要么时候一个有效的,或者就没有这个环境变量。
def _InitHttp():
  handlers = []
  mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
  try:
    import netrc
    n = netrc.netrc()
    for host in n.hosts:
      p = n.hosts[host]
      mgr.add_password(p[1], 'http://%s/' % host, p[0], p[2])
      mgr.add_password(p[1], 'https://%s/' % host, p[0], p[2])
  except:
    pass
  handlers.append(urllib.request.HTTPBasicAuthHandler(mgr))
  handlers.append(urllib.request.HTTPDigestAuthHandler(mgr))
  if 'http_proxy' in os.environ:
    url = os.environ['http_proxy']
    handlers.append(urllib.request.ProxyHandler({'http': url, 'https': url}))
  if 'REPO_CURL_VERBOSE' in os.environ:
    handlers.append(urllib.request.HTTPHandler(debuglevel=1))
    handlers.append(urllib.request.HTTPSHandler(debuglevel=1))
  urllib.request.install_opener(urllib.request.build_opener(*handlers))
解决方法
- 如果是本地需要代理,就设置一个代理
set http_proxy=http://user:pass@host:port
set https_proxy=https://user:pass@host:port
- 不需要代理就unset代理即可
unset https_proxy
unset http_proxy
- 永久的移除或者添加一个代理
cat /etc/enviroment
我还分享在这里了
https://stackoverflow.com/questions/38594080/fatal-cannot-get-https-gerrit-googlesource-com-git-repo-clone-bundle-fatal-e/57968927#57968927
            
            作者:叉叉敌
            
            博客:https://chasays.github.io/
            
            微信公众号:Chasays, 欢迎关注一起吹牛逼,也可以加个人微信号「xxd_0225」互吹。
            
            本博客大多为学习笔记或读书笔记,本文如对您有帮助,还请多推荐下此文,如有错误欢迎指正,相互学习,共同进步。
        

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号