Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning of a group fails with MissingSchema error #5

Open
miguelaferreira opened this issue May 4, 2021 · 4 comments
Open

Cloning of a group fails with MissingSchema error #5

miguelaferreira opened this issue May 4, 2021 · 4 comments

Comments

@miguelaferreira
Copy link

Fresh installation of gitlab-clone:

pip install --user gitlab-clone 
Collecting gitlab-clone
  Downloading gitlab_clone-1.1.0-py2.py3-none-any.whl (4.4 kB)
Requirement already satisfied: requests in /Users/miguel/Library/Python/3.9/lib/python/site-packages (from gitlab-clone) (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/miguel/Library/Python/3.9/lib/python/site-packages (from requests->gitlab-clone) (1.26.3)
Requirement already satisfied: certifi>=2017.4.17 in /Users/miguel/Library/Python/3.9/lib/python/site-packages (from requests->gitlab-clone) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in /Users/miguel/Library/Python/3.9/lib/python/site-packages (from requests->gitlab-clone) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /Users/miguel/Library/Python/3.9/lib/python/site-packages (from requests->gitlab-clone) (4.0.0)
Installing collected packages: gitlab-clone
Successfully installed gitlab-clone-1.1.0

Then trying to clone a group from gitlab.com produces this error:

gitlab-clone --group=123 --token=ABC --gitlab-url gitlab.com
Traceback (most recent call last):
  File "/Users/miguel/Library/Python/3.9/bin/gitlab-clone", line 8, in <module>
    sys.exit(main())
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/gitlab_clone/clonner.py", line 24, in main
    clone(**request_param)
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/gitlab_clone/clonner.py", line 32, in clone
    response = requests.get(
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/Users/miguel/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'gitlab.com/api/v4/groups/123/projects?private_token=ABC&include_subgroups=True&per_page=100&page=1&with_shared=False': No schema supplied. Perhaps you meant http://gitlab.com/api/v4/groups/123/projects?private_token=ABC&include_subgroups=True&per_page=100&page=1&with_shared=False?
@LaserPhaser
Copy link
Owner

@miguelaferreira Thank you for your report. will check it in 1 day

@tomirio619
Copy link

You can circumvent this by specifying the scheme in the Gitlab URL provided to --gitlab-url:

$ gitlab-clone --group=123 --token=ABC --gitlab-url https://gitlab.com

@r3c4ll
Copy link

r3c4ll commented Sep 15, 2022

Hi, here running it from Debian 11 today:

~/.local/bin/gitlab-clone --group=my-group-id --token=my-token --gitlab-url=https://gitlab.com

And it start cloning the group and all subgroups resulting in a directory structure equivalent to that I have in GitLab but...

Enter passphrase for key '/home/my-user/.ssh/id_rsa': 
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Obviously it is an issue with the id_rsa, I'll try to figure it out but will be great to have a little more documentation.
Not to much activity here right?

@eulenleber
Copy link
Contributor

I had a similar error (correct access rights) as the server dropped the connections when there were to many at once...

for me i fixed that in PR #8
Just to be sure, you can execute the corresponding git clone ... command without problems?
ssh-agent up and containing the key? (Popen probably wont ask for password input) - otherwise try http (see my former PR) - it will use the token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants