15

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

but I get the following error when trying to initialize the repo in the working directory (using 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

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.

user1032187
  • 201
  • 1
  • 2
  • 8
  • any progress on that ? i am facing same issue – r4jiv007 Dec 12 '14 at 06:08
  • 7
    I had a somewhat similiar issue but I was able to download https://gerrit.googlesource.com/git-repo/clone.bundle in my browser, so once I did that I could use the undocumented repo parameter from this answer: http://stackoverflow.com/a/18899032/85472 like so: repo init -u https://android.googlesource.com/a/platform/manifest --repo-url – Maks May 10 '16 at 04:52
  • @Maks you should make this an answer (it also worked for me). – Étienne Dec 03 '19 at 14:37

6 Answers6

14

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

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

insert the below detail after 'import sys'

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

then save this file, and retry again

Johann
  • 27,536
  • 39
  • 165
  • 279
叉叉敌
  • 374
  • 3
  • 9
3

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

vlz
  • 31
  • 1
3

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

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.

i have solved with:

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

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 sync command succeeded.

JLa
  • 31
  • 4
  • Hello , I am also getting the same error as you have reported.Can you please explain your steps.I didnt get --repo-url option .Many thanks in advance ! – Raulp Mar 28 '19 at 04:11
  • 3
    You need to manually download clone.bundle with your browser, e.g. to ~/Downloads. Then do 'repo init -u .... --repo-url ~/Downloads/clone.bundle' – JLa Mar 29 '19 at 07:23
  • Thanks a lot ,'repo init -u .... --repo-url ~/Downloads/clone.bundle' what does ... (dot dot dot ) stands for here..? – Raulp Mar 29 '19 at 07:45
1

might require to rebuild/reinstall python with libssl-dev installed before

Oleg Kokorin
  • 2,288
  • 2
  • 16
  • 28
0

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

repo init -u https://android.googlesource.com/a/platform/manifest --repo-url <location-where-you-downloaded-clone.bundle>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Maks
  • 7,562
  • 6
  • 43
  • 65
  • 1
    ...this is a buggy tool from Google. If you put the bundle e.g. in your directory where you're working from, be sure to provide the absolute path or the path RELATIVE TO YOUR USER DIRECTORY i.e. `~`. It appears the tool mistakenly interprets e.g. './' as a url. – smaudet Jan 31 '20 at 15:53