ezbz / gitlabber

Gitlabber - clones or pulls entire groups tree from gitlab
MIT License
472 stars 78 forks source link

Supplied Gitlab token is not being used #75

Closed migscabral closed 2 years ago

migscabral commented 3 years ago

I'm running the recursive command in our Gitlab.com repo using the command below but I'm getting the error: Please make sure you have the correct access rights and the repository exists.

I redacted the excerpts of the commands and the logs. For reference:

gitlabber -t XXX -u https://gitlab.com -i 'AAA/BBB**' --verbose .

...

'
2021-04-26 18:18:35,712 - gitlabber.git - DEBUG - cloning new project ./AAA/BBB/CCC
2021-04-26 18:18:35,712 - git.cmd - DEBUG - Popen(['git', 'clone', '-v', 'git@gitlab.com:AAA/BBB/CCC', './AAA/BBB/CCC'], cwd=/Users/administrator/Documents/gitlab-backups, universal_newlines=True, shell=None, istream=None)
2021-04-26 18:18:37,452 - git.repo.base - DEBUG - Cmd(['git', 'clone', '-v', 'git@gitlab.com:AAA/BBB/CCC.git', './AAA/BBB/CCC'])'s unused stdout:
2021-04-26 18:18:37,452 - git.cmd - DEBUG - AutoInterrupt wait stderr: b"Cloning into './AAA/BBB/CCC'...\ngit@gitlab.com: Permission denied (publickey,keyboard-interactive).\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
2021-04-26 18:18:37,452 - gitlabber.git - DEBUG - Error cloning project ./AAA/BBB/CCC
Traceback (most recent call last):
  File "/Users/administrator/.pyenv/versions/3.6.13/lib/python3.6/site-packages/gitlabber/git.py", line 78, in clone_or_pull_project
    git.Repo.clone_from(action.node.url, action.path)
  File "/Users/administrator/.pyenv/versions/3.6.13/lib/python3.6/site-packages/git/repo/base.py", line 1032, in clone_from
    return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
  File "/Users/administrator/.pyenv/versions/3.6.13/lib/python3.6/site-packages/git/repo/base.py", line 973, in _clone
    finalize_process(proc, stderr=stderr)
  File "/Users/administrator/.pyenv/versions/3.6.13/lib/python3.6/site-packages/git/util.py", line 329, in finalize_process
    proc.wait(**kwargs)
  File "/Users/administrator/.pyenv/versions/3.6.13/lib/python3.6/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git clone -v git@gitlab.com:/AAA/BBB/CCC.git ./AAA/BBB/CCC
  stderr: 'Cloning into './AAA/BBB/CCC'...
git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

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

...

I'm sure that I have access to the repo and that the token is working. I was able to clone successfully using the command:

git clone https://oauth:XXX@gitlab.com:/AAA/BBB/CCC.git
george-viaud commented 3 years ago

same experience here - using gitlab cloud

ezbz commented 3 years ago

did you try changing the method to http with the -m flag?

Note the successful example you've provided is using the http method but gitlabber's default is ssh

ezbz commented 2 years ago

closing due to inactivity