renku-python icon indicating copy to clipboard operation
renku-python copied to clipboard

Correctly report permission issues.

Open jkminder opened this issue 3 years ago • 0 comments

Hi, this might also be considered a feature request. If a workflow is (re)run that produces a file that overwrites a file for which the user has no permission, renku crashes and reports a bug (even though this is entirely the users fault). Maybe instead of crashing and reporting a bug, the CLI could report "You don't have permission to create this file" or similar. Note that the Error message "Permission denied..." only appears if one types "print" after renku reports the bug. So a user might discard this directly as a bug on renkus side without looking at the error report in detail, instead of quickly fixing the permissions.

Renku version: 1.5.0 OS: Linux (#200-Ubuntu SMP Wed Jun 22 19:53:37 UTC 2022) Python: 3.10.5

Traceback

Traceback (most recent call last):
  File "[...]/shutil.py", line 815, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/1nn1khh_/data/democrasci_parliamentdb/democrasci_parliamentdb_graph.dump' -> '/home/jovyan/work/repositories/democrasci-parliamentdb/data/democrasci_parliamentdb/democrasci_parliamentdb_graph.dump'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "[...]/site-packages/renku/ui/cli/exception_handler.py", line 134, in main
    return super().main(*args, **kwargs)
  File "[...]/site-packages/renku/ui/cli/exception_handler.py", line 93, in main
    return super().main(*args, **kwargs)
  File "[...]/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "[...]/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "[...]/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "[...]/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "[...]/site-packages/renku/ui/cli/update.py", line 179, in update
    update_command()
  File "[...]/site-packages/renku/command/command_builder/command.py", line 296, in execute
    output = context["click_context"].invoke(self._operation, *args, **kwargs)
  File "[...]/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "[...]/site-packages/inject/__init__.py", line 342, in injection_wrapper
    return sync_func(*args, **kwargs)
  File "[...]/site-packages/renku/command/update.py", line 84, in _update
    execute_workflow(dag=graph.workflow_graph, provider=provider, config=config)
  File "[...]/site-packages/inject/__init__.py", line 342, in injection_wrapper
    return sync_func(*args, **kwargs)
  File "[...]/site-packages/renku/command/workflow.py", line 563, in execute_workflow
    execute(dag=dag, basedir=client.path, provider=provider, config=config)
  File "[...]/site-packages/renku/core/plugin/provider.py", line 95, in execute
    return executor(dag=dag, basedir=basedir, config=config)
  File "[...]/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "[...]/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "[...]/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "[...]/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "[...]/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "[...]/site-packages/renku/core/workflow/providers/cwltool.py", line 144, in workflow_execute
    shutil.move(location, str(destination))
  File "[...]/shutil.py", line 835, in move
    copy_function(src, real_dst)
  File "[...]/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "[...]/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '**************/repositories/democrasci-parliamentdb/data/democrasci_parliamentdb/democrasci_parliamentdb_graph.dump'

jkminder avatar Aug 24 '22 14:08 jkminder