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

GitCommandError: Git command failed: Cmd('git') failed due to: exit code(128) #2826

Closed
sentry-dev-app bot opened this issue Apr 11, 2022 · 0 comments · Fixed by #2878
Closed

GitCommandError: Git command failed: Cmd('git') failed due to: exit code(128) #2826

sentry-dev-app bot opened this issue Apr 11, 2022 · 0 comments · Fixed by #2878

Comments

@sentry-dev-app
Copy link

We should fix the Repository implementation so it's clear that we want to reset to a reference, by adding -- in the subprocess call


Sentry Issue: RENKU-PYTHON-3E

GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git reset --hard origin/master
  stderr: 'fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]''
  File "renku/core/metadata/repository.py", line 1397, in _run_git_command
    return getattr(repository.git, command)(*args, **kwargs)
  File "git/cmd.py", line 638, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "git/cmd.py", line 1183, in _call_process
    return self.execute(call, **exec_kwargs)
  File "git/cmd.py", line 983, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)

GitCommandError: Git command failed: Cmd('git') failed due to: exit code(128)
  cmdline: git reset --hard origin/master
  stderr: 'fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]''
(7 additional frame(s) were not displayed)
...
  File "renku/service/controllers/api/mixins.py", line 225, in execute_op
    self.reset_local_repo(project)
  File "renku/service/controllers/api/mixins.py", line 274, in reset_local_repo
    repository.reset(f"{origin}/{repository.active_branch}", hard=True)
  File "renku/core/metadata/repository.py", line 251, in reset
    self.run_git_command("reset", _to_string(reference), hard=hard)
  File "renku/core/metadata/repository.py", line 263, in run_git_command
    return _run_git_command(self._repository, command, *args, **kwargs)
  File "renku/core/metadata/repository.py", line 1405, in _run_git_command
    ) from e
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

Successfully merging a pull request may close this issue.

0 participants