Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external_repo doesn't support symlinks #3348

Closed
gurobokum opened this issue Feb 17, 2020 · 1 comment
Closed

external_repo doesn't support symlinks #3348

gurobokum opened this issue Feb 17, 2020 · 1 comment
Labels
bug Did we break something? p2-medium Medium priority, should be done, but less important

Comments

@gurobokum
Copy link
Contributor

If repo contains symlink during dvc list/get cli commands (external_repo clone) the process crashes

(dvc) jiojiajiu@pon4ik:~/workspace/DVC/dvc$ python -m dvc list test-project -v
2020-02-17 16:15:52,989 DEBUG: Creating external repo test-project@None
2020-02-17 16:15:53,145 ERROR: unexpected error - can't copy '/tmp/tmpt0f2eavwdvc-clone/.travis.yml': doesn't exist or not a regular file
------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jiojiajiu/workspace/DVC/dvc/dvc/main.py", line 49, in main
    ret = cmd.run()
  File "/home/jiojiajiu/workspace/DVC/dvc/dvc/command/ls.py", line 40, in run
    with_color=with_color,
  File "/home/jiojiajiu/workspace/DVC/dvc/dvc/repo/ls.py", line 15, in ls
    with external_repo(url, rev) as repo:
  File "/home/jiojiajiu/.pyenv/versions/3.7.6/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/jiojiajiu/workspace/DVC/dvc/dvc/external_repo.py", line 28, in external_repo
    path = _cached_clone(url, rev, for_write=for_write)
  File "/home/jiojiajiu/workspace/DVC/dvc/dvc/external_repo.py", line 198, in _cached_clone
    copy_tree(clone_path, repo_path)
  File "/home/jiojiajiu/.pyenv/versions/3.7.6/lib/python3.7/distutils/dir_util.py", line 163, in copy_tree
    dry_run=dry_run)
  File "/home/jiojiajiu/.pyenv/versions/3.7.6/lib/python3.7/distutils/file_util.py", line 105, in copy_file
    "can't copy '%s': doesn't exist or not a regular file" % src)
distutils.errors.DistutilsFileError: can't copy '/tmp/tmpt0f2eavwdvc-clone/.travis.yml': doesn't exist or not a regular file

Please provide information about your setup

$ dvc --version
0.85.0+57d021.mod

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"

@triage-new-issues triage-new-issues bot added the triage Needs to be triaged label Feb 17, 2020
@efiop efiop added the bug Did we break something? label Feb 18, 2020
@triage-new-issues triage-new-issues bot removed the triage Needs to be triaged label Feb 18, 2020
@efiop efiop added p2-medium Medium priority, should be done, but less important triage Needs to be triaged labels Feb 18, 2020
@triage-new-issues triage-new-issues bot removed the triage Needs to be triaged label Feb 18, 2020
@omesser
Copy link
Contributor

omesser commented Apr 23, 2023

I think this is no longer relevant.
Not sure the exact reproductions steps (using external_repo.py in issue description, I think test-repo was just a local dvc repo with some symlink)
But:

  • Code path changed since then
  • Trying this with a local dvc project worked ok for me today:
❯ ll dvc_symlink
total 8
-rw-r--r--   1 oded  staff   139B Apr 23 18:26 .dvcignore
drwxr-xr-x  10 oded  staff   320B Apr 23 18:40 ..
lrwxr-xr-x   1 oded  staff    49B Apr 23 18:40 some_dir -> /Users/oded/iterative/misc_workspace/tmp/some_dir
drwxr-xr-x   6 oded  staff   192B Apr 23 18:41 .
drwxr-xr-x   5 oded  staff   160B Apr 23 18:41 .dvc
drwxr-xr-x  10 oded  staff   320B Apr 23 18:41 .git
❯ dvc list dvc_symlink -v
2023-04-23 18:49:42,562 DEBUG: v2.55.0 (pip), CPython 3.8.12 on macOS-13.0-arm64-arm-64bit
2023-04-23 18:49:42,562 DEBUG: command: /Users/oded/.pyenv/versions/3.8.12/bin/dvc list dvc_symlink -v
.dvcignore
some_dir
2023-04-23 18:49:43,019 DEBUG: Analytics is enabled.
2023-04-23 18:49:43,056 DEBUG: Trying to spawn '['daemon', '-q', 'analytics', '/var/folders/jv/_f59qsz50s3f5ygmv5w1xh0h0000gn/T/tmpxyu24bha']'
2023-04-23 18:49:43,057 DEBUG: Spawned '['daemon', '-q', 'analytics', '/var/folders/jv/_f59qsz50s3f5ygmv5w1xh0h0000gn/T/tmpxyu24bha']'

DVC version data:

❯ dvc version
DVC version: 2.55.0 (pip)
-------------------------
Platform: Python 3.8.12 on macOS-13.0-arm64-arm-64bit
Subprojects:
	dvc_data = 0.47.2
	dvc_objects = 0.21.1
	dvc_render = 0.3.1
	dvc_task = 0.2.0
	scmrepo = 1.0.2
Supports:
	http (aiohttp = 3.7.4, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.7.4, aiohttp-retry = 2.8.3),
	s3 (s3fs = 2023.3.0, boto3 = 1.24.59)

Closing, please re-open if I missed something

@omesser omesser closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something? p2-medium Medium priority, should be done, but less important
Projects
None yet
Development

No branches or pull requests

3 participants