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

Cannot handle multi part git repositories #1651

Closed
2 tasks done
AzaelCicero opened this issue Jun 5, 2020 · 1 comment
Closed
2 tasks done

Cannot handle multi part git repositories #1651

AzaelCicero opened this issue Jun 5, 2020 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AzaelCicero
Copy link
Contributor

My actions before raising this issue

Version 1.0.0
Regexes in https://github.com/opencv/cvat/blob/1b413c65a2a62d39876d074902eabd93cd7f9f41/cvat/apps/git/git.py#L75 assumes that address has only one part address (i.e. git@github.com:something/reponame.git or https://github.com/something/reponame.git) it will fail if provided address has multiple parts (i.e. git@github.com:something/group/subgroup/reponame.git or https://github.com/something/group/subgroup/reponame.git)

Expected Behaviour

It should accept multi part repository addresses

Current Behaviour

CVAT will trim address to first part and will try to pull from it:
Input:
git@github.com:something/group/subgroup/reponame.git
Command called by CVAT
git clone -v git@github.com:something/group.git /home/django/data/tasks/12/artifacts/repos

Possible Solution

Alter regexes to accept multipart repository address.

Steps to Reproduce (for bugs)

  1. Create new task with GIT repository git@github.com:something/group/subgroup/reponame.git
  2. Try submit which will fail

Context

I am using groups in gitlab to organize my repositories.

Your Environment

  • Git hash commit (git log -1):
  • Docker version docker version (e.g. Docker 17.0.05):
  • Are you using Docker Swarm or Kubernetes?
  • Operating System and version (e.g. Linux, Windows, MacOS):
  • Code example or link to GitHub repo or gist to reproduce problem:
  • Other diagnostic information / logs:
    Logs from `cvat` container [2020-06-05 07:46:49,597] INFO cvat.server: create task Keypoint Annotation #12

[2020-06-05 07:46:50,886] INFO cvat.server: Founded frames 2 for Data #12
[2020-06-05 07:46:50,887] INFO cvat.server: New segment for task #12: start_frame = 0, stop_frame = 1
[2020-06-05 07:46:51,681] INFO cvat.server.task_12: create repository request
[2020-06-05 07:46:51,695] INFO cvat.server.task_12: Local repository initialization..
[2020-06-05 07:46:51,697] INFO cvat.server.task_12: Cloning remote repository from git@gitlab.com:name/group.git..
[2020-06-05 07:46:52,893] ERROR cvat.server.task_12: exception occured during git initial_create
Traceback (most recent call last):
File "/home/django/cvat/apps/git/git.py", line 218, in init_repos
self._rep = git.Repo(self._cwd)
File "/usr/local/lib/python3.5/dist-packages/git/repo/base.py", line 130, in init
raise NoSuchPathError(epath)
git.exc.NoSuchPathError: /home/django/data/tasks/12/artifacts/repos

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/django/cvat/apps/git/git.py", line 384, in initial_create
_git.init_repos()
File "/home/django/cvat/apps/git/git.py", line 231, in init_repos
self._clone()
File "/home/django/cvat/apps/git/git.py", line 164, in _clone
self._rep = git.Repo.clone_from(ssh_url, self._cwd)
File "/usr/local/lib/python3.5/dist-packages/git/repo/base.py", line 1017, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/git/repo/base.py", line 958, in _clone
finalize_process(proc, stderr=stderr)
File "/usr/local/lib/python3.5/dist-packages/git/util.py", line 328, in finalize_process
proc.wait(**kwargs)
File "/usr/local/lib/python3.5/dist-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:name/group.git /home/django/data/tasks/12/artifacts/repos
stderr: 'Cloning into '/home/django/data/tasks/12/artifacts/repos'...
remote:
remote: ========================================================================
remote:
remote: The project you were looking for could not be found.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/django/cvat/apps/git/git.py", line 387, in initial_create
_have_no_access_exception(ex)
File "/home/django/cvat/apps/git/git.py", line 35, in _have_no_access_exception
'Available public keys are: ' + str(keys)
Exception: Could not connect to the remote repository. Please make sure you have the correct access rights and the repository exists. Available public keys are: ['ssh-rsa XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /home/django/.ssh/id_rsa']

</details>

Next steps

You may join our Gitter channel for community support.

@azhavoro azhavoro added the bug Something isn't working label Jun 5, 2020
@azhavoro
Copy link
Contributor

azhavoro commented Jun 5, 2020

Hi, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants