Hi Paffciu,
I’m still facing this issue.
The result of the “gc -v” command is in my case
user@coltrane:~/Projects/static_project_template$ dvc gc -v -c -w -p /home/user/Projects/static_project_template /home/user/Projects/static_project_template_bis
2022-05-27 13:51:01,831 WARNING: This will remove all cache except items used in the workspace of the current and the following repos:
- /home/user/Projects/static_project_template
- /home/user/Projects/static_project_template_bis
Are you sure you want to proceed? [y/n]: y
2022-05-27 13:51:06,396 ERROR: Unable to acquire lock. Most likely another DVC process is running or was terminated abruptly. Check the page <https://dvc.org/doc/user-guide/troubleshooting#lock-issue> for other possible reasons and to learn how to resolve this.
------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/.dvc-venv/lib/python3.9/site-packages/zc/lockfile/__init__.py", line 59, in _lock_file
fcntl.flock(file.fileno(), _flags)
BlockingIOError: [Errno 11] Resource temporarily unavailable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/lock.py", line 112, in _do_lock
self._lock = zc.lockfile.LockFile(self._lockfile)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/zc/lockfile/__init__.py", line 117, in __init__
super(LockFile, self).__init__(path)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/zc/lockfile/__init__.py", line 90, in __init__
_lock_file(fp)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/zc/lockfile/__init__.py", line 61, in _lock_file
raise LockError("Couldn't lock %r" % file.name)
zc.lockfile.LockError: Couldn't lock '/home/user/Projects/static_project_template/.dvc/tmp/lock'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/cli/__init__.py", line 89, in main
ret = cmd.do_run()
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/cli/command.py", line 22, in do_run
return self.run()
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/commands/gc.py", line 51, in run
self.repo.gc(
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/repo/__init__.py", line 48, in wrapper
return f(repo, *args, **kwargs)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/repo/gc.py", line 58, in gc
stack.enter_context(repo.lock)
File "/home/user/.dvc-venv/lib/python3.9/contextlib.py", line 448, in enter_context
result = _cm_type.__enter__(cm)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/lock.py", line 131, in __enter__
self.lock()
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/lock.py", line 120, in lock
lock_retry()
File "/home/user/.dvc-venv/lib/python3.9/site-packages/funcy/decorators.py", line 45, in wrapper
return deco(call, *dargs, **dkwargs)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/funcy/flow.py", line 127, in retry
return call()
File "/home/user/.dvc-venv/lib/python3.9/site-packages/funcy/decorators.py", line 66, in __call__
return self._func(*self._args, **self._kwargs)
File "/home/user/.dvc-venv/lib/python3.9/site-packages/dvc/lock.py", line 114, in _do_lock
raise LockError(FAILED_TO_LOCK_MESSAGE)
dvc.lock.LockError: Unable to acquire lock. Most likely another DVC process is running or was terminated abruptly. Check the page <https://dvc.org/doc/user-guide/troubleshooting#lock-issue> for other possible reasons and to learn how to resolve this.
------------------------------------------------------------
I have two git repo I created to reproduce this issue, “static_project_template” and “static_project_template_bis” that are sharing the same cache and remote.
I’m able to use “dvc gc” in any of these repo, but I’m not able to use it with the “-p” option that is necessary in my case.