无法获取 https://gerrit.googlesource.com/git-repo/clone.bundle

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26646741/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:30:29  来源:igfitidea点击:

Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle

gitgithubrepositoryrepo

提问by user1032187

I tried to create a git repo with the instructions from "source.android.com/source/downloading.html#installing-repo"

我尝试使用“source.android.com/source/downloading.html#installing-repo”中的说明创建一个 git repo

but I get the following error when trying to initialize the repo in the working directory (using Ubuntu):

但是在尝试初始化工作目录中的 repo 时出现以下错误(使用 Ubuntu):

:~/workdir$ repo init -u https://android.googlesource.com/a/platform/manifest
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno -2] Name or service not known

:~/workdir$ repo init -u https://android.googlesource.com/a/platform/manifest
fatal: 无法获取https://gerrit.googlesource.com/git-repo/clone.bundle
致命: 错误 [Errno -2] 名称或服务未知

I have created the ~/.netrc file with generated password and also set the HTTP_PROXY and HTTPS_PROXY variables.
When I try to access the above clone.bundle link through a browser, I get "not found" error.
Please let me know if some additional settings need to be done. Thanks in advance.

我已经使用生成的密码创建了 ~/.netrc 文件,并设置了 HTTP_PROXY 和 HTTPS_PROXY 变​​量。
当我尝试通过浏览器访问上述 clone.bundle 链接时,出现“未找到”错误。
如果需要做一些额外的设置,请告诉我。提前致谢。

回答by u6876792

error

错误

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle 
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

you can modify this repo file for this issue, please follow the below commands

您可以针对此问题修改此 repo 文件,请按照以下命令操作

sudo cp /usr/bin/repo /usr/bin/repo_bak
sudo vi /usr/bin/repo

insert the below detail behind 'import sys'

在“import sys”后面插入以下详细信息

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

then save this file, and retry again

然后保存此文件,然后重试

回答by JLa

FYI: here how I solved it:

仅供参考:这里我是如何解决它的:

The second line of my error was different:

我的错误的第二行是不同的:

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

But the remark in the question above worked for me (download clone.bundle, and use the --repo-url option). It gave however errors in the python code in .repo/. But I ignored that, and the repo synccommand succeeded.

但是上面问题中的评论对我有用(下载 clone.bundle,并使用 --repo-url 选项)。然而,它在 .repo/ 中的 python 代码中给出了错误。但我忽略了这一点,repo sync命令成功了。

回答by vlz

I suppose the issue will be solved by installing openssl and ca-certificates packages.

我想这个问题将通过安装 openssl 和 ca-certificates 包来解决。

回答by Maks

I had a somewhat similiar issue but I was able to download https://gerrit.googlesource.com/git-repo/clone.bundlein my browser, so once I did that I could use the undocumented repo parameter from this answer: http://stackoverflow.com/a/18899032/85472like so:

我有一个有点类似的问题,但我能够在浏览器中下载https://gerrit.googlesource.com/git-repo/clone.bundle,所以一旦我这样做了,我就可以使用这个答案中未记录的 repo 参数:http ://stackoverflow.com/a/18899032/85472像这样:

repo init -u https://android.googlesource.com/a/platform/manifest --repo-url <location-where-you-downloaded-clone.bundle>

回答by Luca Scandroglio

i am a MAC user (Mojave). I have the same error.

我是 MAC 用户(莫哈韦沙漠)。我有同样的错误。

When i launch:

当我启动时:

repo init <repository url>

I get this error:

我收到此错误:

Downloading Repo source from https://gerrit.googlesource.com/git-repo
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
fatal: cloning the git-repo repository failed, will remove '.repo/repo'

The problem seems due to Python 3.6 on MacOS that comes with its own private copy of OpenSSL. That means the trust certificates in the system are no longer used as defaults by the Python ssl module. To fix that, you need to install a certifi package in your system.

问题似乎是由于 MacOS 上的 Python 3.6 带有自己的 OpenSSL 私有副本。这意味着系统中的信任证书不再被 Python ssl 模块用作默认值。要解决这个问题,您需要在系统中安装一个 certifi 包。

i have solved with:

我已经解决了:

open /Applications/Python\ 3.6/Install\ Certificates.command