Skip to content

Conversation

@gh2o
Copy link
Contributor

@gh2o gh2o commented Jan 8, 2022

dvc.fs.utils.test_links() fails with a CacheLinkError if the target to_path does not already exist, as is the case when "abc.dvc" exists (referring to a directory object) and we try to run "dvc pull abc/def". To avoid this issue, fully create to_path before attempting to create a link in it.

Example error log which this should fix:

2022-01-08 00:58:31,286 ERROR: failed to pull data from the cloud - No possible cache link types for '/<REPO>/<OBJECT>/<SUBDIR>'. See <https://dvc.org/doc/user-guide/troubleshooting#cache-types> for more information.
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/dvc/command/data_sync.py", line 30, in run
    stats = self.repo.pull(
  File "/usr/local/lib/python3.8/dist-packages/dvc/repo/__init__.py", line 49, in wrapper
    return f(repo, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/dvc/repo/pull.py", line 40, in pull
    stats = self.checkout(
  File "/usr/local/lib/python3.8/dist-packages/dvc/repo/__init__.py", line 49, in wrapper
    return f(repo, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/dvc/repo/checkout.py", line 98, in checkout
    result = stage.checkout(
  File "/usr/local/lib/python3.8/dist-packages/funcy/decorators.py", line 45, in wrapper
    return deco(call, *dargs, **dkwargs)
  File "/usr/local/lib/python3.8/dist-packages/dvc/stage/decorators.py", line 36, in rwlocked
    return call()
  File "/usr/local/lib/python3.8/dist-packages/funcy/decorators.py", line 66, in __call__
    return self._func(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/dvc/stage/__init__.py", line 572, in checkout
    key, outs = self._checkout(
  File "/usr/local/lib/python3.8/dist-packages/dvc/stage/__init__.py", line 584, in _checkout
    result = out.checkout(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/dvc/output.py", line 756, in checkout
    modified = checkout(
  File "/usr/local/lib/python3.8/dist-packages/dvc/objects/checkout.py", line 241, in checkout
    _checkout(
  File "/usr/local/lib/python3.8/dist-packages/dvc/objects/checkout.py", line 164, in _checkout
    raise CacheLinkError([fs_path])
dvc.exceptions.CacheLinkError: No possible cache link types for '/<REPO>/<OBJECT>/<SUBDIR>'. See <https://dvc.org/doc/user-guide/troubleshooting#cache-types> for more information.

`dvc.fs.utils.test_links()` fails with a CacheLinkError if the target `to_path` does not already exist, as is the case when "abc.dvc" exists (referring to a directory object) and we try to run "dvc pull abc/def". To avoid this issue, fully create `to_path` before attempting to create a link in it.
@gh2o gh2o requested a review from a team as a code owner January 8, 2022 02:48
@gh2o gh2o requested a review from dtrifiro January 8, 2022 02:48
@efiop efiop requested review from efiop and removed request for dtrifiro January 8, 2022 11:55
@efiop
Copy link
Contributor

efiop commented Jan 8, 2022

Thanks, @gh2o 🙏

@efiop efiop merged commit 92f714e into treeverse:main Jan 8, 2022
@efiop efiop added the bugfix fixes bug label Jan 8, 2022
@sjawhar
Copy link
Contributor

sjawhar commented Feb 6, 2022

Is a hotfix release on the schedule soon? This bugfix is what I need to be able to upgrade to 2.9.x (was actually about to make the fix myself 😄 )

@efiop
Copy link
Contributor

efiop commented Feb 6, 2022

@sjawhar We have a few release blockers that we need to sort out first https://github.com/iterative/dvc/issues?q=is%3Aopen+is%3Aissue+label%3Arelease-blocker Thank you for your patience 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants