renku-python
renku-python copied to clipboard
`renku dataset unlink` fails for dataset with cloud storage
Describe the bug
If we pull data for a dataset with cloud storage backend, then renku dataset unlink won't work.
To Reproduce Steps to reproduce the behavior:
- Create a project
renku dataset create s3-data --storage s3://s3.amazonaws.com/giab/technical/unimask/renku dataset add s3-data s3://s3.amazonaws.com/giab/technical/unimask/00README.txtrenku dataset pull s3-datarenku dataset unlink -I 00README.txt s3-data
$ renku dataset unlink -I 00README.txt s3-data
Warning: You are about to remove following from "s3-data" dataset.
data/s3-data/00README.txt
Do you wish to continue? [y/N]: y
Error: Git command failed: Cmd('git') failed due to: exit code(128)
cmdline: git add data/s3-data/00README.txt
stderr: 'fatal: pathspec 'data/s3-data/00README.txt' did not match any files'
Traceback (most recent call last):
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/repository.py", line 1780, in _run_git_command
return getattr(repository.git, command)(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/git/cmd.py", line 639, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/git/cmd.py", line 1184, in _call_process
return self.execute(call, **exec_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/git/cmd.py", line 984, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git add data/s3-data/00README.txt
stderr: 'fatal: pathspec 'data/s3-data/00README.txt' did not match any files'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/exception_handler.py", line 92, in main
return super().main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/dataset.py", line 917, in unlink
file_unlink_command().with_communicator(communicator).build().execute(
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/command/command_builder/command.py", line 266, in execute
hook(self, context, result, *args, **kwargs)
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/command/command_builder/command.py", line 202, in _post_hook
raise result.error
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/command/command_builder/command.py", line 252, in execute
output = self._operation(*args, **kwargs) # type: ignore
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/core/dataset/dataset.py", line 371, in file_unlink
repository.add(path_file)
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/repository.py", line 229, in add
self.run_git_command("add", *batch, force=force)
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/repository.py", line 406, in run_git_command
return _run_git_command(self._repository, command, *args, **kwargs)
File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/repository.py", line 1782, in _run_git_command
raise errors.GitCommandError(
renku.core.errors.GitCommandError: Git command failed: Cmd('git') failed due to: exit code(128)
cmdline: git add data/s3-data/00README.txt
stderr: 'fatal: pathspec 'data/s3-data/00README.txt' did not match any files'