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.


Renku Version:

renku --version

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+ (or pip install git+ 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/", line 192, in Lock
    with portalocker.Lock(filename, timeout=timeout, flags=flags):
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/portalocker/", line 157, in __enter__
    return self.acquire()
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/portalocker/", 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/", line 90, in main
    return super().main(*args, **kwargs)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/", line 1078, in main
    rv = self.invoke(ctx)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/click/", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/ui/cli/", line 823, in add
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/", line 264, in execute
    hook(self, context, result, *args, **kwargs)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/", line 200, in _post_hook
    raise result.error
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/command/command_builder/", line 250, in execute
    output = self._operation(*args, **kwargs)  # type: ignore
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/dataset/", line 87, in add_to_dataset
    files = get_files_metadata(
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/dataset/", 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/", 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/", line 43, in get_value
    config = load_config(config_filter=config_filter)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/", line 118, in load_config
    with global_config_read_lock():
  File "/myhome/mambaforge/envs/ml/lib/python3.11/", line 137, in __enter__
    return next(self.gen)
  File "/myhome/mambaforge/envs/ml/lib/python3.11/site-packages/renku/core/util/", 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.