Dataset add BUG

When using ‘renku dataset add’ I always get ‘Unable to acquire lock.’. Removing ‘.renku.lock’ before won’t help. This also doesn’t help.

Repository:

Renku Version:

renku --version
2.8.0

Considering this post:

I’m using renku on the runai partitions of the SDSC. I’m not sure how the home dir is mounted.

Can you help me?

I quickly made a version that produces more error output, you can install it with pipx install git+https://github.com/SwissDataScienceCenter/renku-python@fix-lock (or pip install git+https://github.com/SwissDataScienceCenter/renku-python@fix-lock if you use pip) and then run your command again. Hopefully that will produce more error output that we can use to figure out the issue.

Can you quickly guide me through how I manually change the minimum required renku version of a project?

Error: You are using renku version 2.7.0.dev34+g45772746.dirty but this project requires at least version 2.8.0. Please upgrade renku to work on this project.

oh right, since it’s a development version it gets confused. you can just prepend your commands with RENKU_SKIP_MIN_VERSION_CHECK=1 like RENKU_SKIP_MIN_VERSION_CHECK=1 senku dataset add ... or do export RENKU_SKIP_MIN_VERSION_CHECK=1 to persist it for all commands.

(ml) root@graph-0-0:~/repositories/democrasci-summarydocdb# RENKU_SKIP_MIN_VERSION_CHECK=1 renku dataset add democrasci_summarydocs data/democrasci_summarydocs/neo4j.dump
Unable to acquire lock.
Traceback (most recent call last):
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/util/contexts.py", line 192, in Lock
    with portalocker.Lock(filename, timeout=timeout, flags=flags):
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/portalocker/utils.py", line 157, in __enter__
    return self.acquire()
           ^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/portalocker/utils.py", line 272, in acquire
    raise exceptions.LockException(exception)
portalocker.exceptions.LockException: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/ui/cli/exception_handler.py", line 90, in main
    return super().main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/ui/cli/dataset.py", line 823, in add
    add_to_dataset_command()
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/command.py", line 264, in execute
    hook(self, context, result, *args, **kwargs)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/command.py", line 200, in _post_hook
    raise result.error
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/command.py", line 250, in execute
    output = self._operation(*args, **kwargs)  # type: ignore
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/dataset/dataset_add.py", line 87, in add_to_dataset
    files = get_files_metadata(
            ^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/dataset/dataset_add.py", line 172, in get_files_metadata
    new_files = provider.get_metadata(
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/dataset/providers/local.py", line 130, in get_metadata
    action = get_value("renku", "default_dataset_add_action")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/config.py", line 43, in get_value
    config = load_config(config_filter=config_filter)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/config.py", line 118, in load_config
    with global_config_read_lock():
  File "/myhome/mambaforge/envs/ml/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/util/contexts.py", line 195, in Lock
    raise errors.LockError(f"Cannot lock {e.__class__.__name__}")
renku.core.errors.LockError: Cannot lock LockException

Hint: Please wait for another renku process to finish and then try again.
(ml) root@graph-0-0:~/repositories/democrasci-summarydocdb#

so this confirms that you have the same issue as the issue you linked above.
You could try some other folders for the HOME=/... workaround you linked above, it depends if there’s some folder in your deployment that is mounted differently.
Unfortunately, we can’t really fix this in code as it depends on a fix in the portalocker/cachier libraries.