zoukankan      html  css  js  c++  java
  • fatal: Cannot get https://gerrit.googlesource.com/gitrepo/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))
    
    

    解决方法

    1. 如果是本地需要代理,就设置一个代理
    set http_proxy=http://user:pass@host:port
    set https_proxy=https://user:pass@host:port
    
    1. 不需要代理就unset 代理即可
    unset https_proxy
    unset http_proxy
    
    1. 永久的移除或者添加一个代理
    cat /etc/enviroment
    

    我还分享在这里了
    https://stackoverflow.com/questions/38594080/fatal-cannot-get-https-gerrit-googlesource-com-git-repo-clone-bundle-fatal-e/57968927#57968927

  • 相关阅读:
    Eclipse / android studio 添加第三方jar包 步骤
    Android checkbox 自定义点击效果
    Android 程序打包和安装过程
    Android 基础
    (转)Genymotion安装virtual device的“unable to create virtual device, Server returned Http status code 0”的解决方法
    (转)eclipse 导入Android 项目 步骤
    微信开放平台注册 步骤
    Android Studio 初级安装
    数组
    作用域问题代码
  • 原文地址:https://www.cnblogs.com/ievjai/p/14382673.html
Copyright © 2011-2022 走看看