Skip to content

dvc move fails when cache dir is read-only #4232

Closed as not planned
Closed as not planned
@florianspecker

Description

@florianspecker
$ dvc move -v f6cf36bfd9b914e4_890986178457_00_122.png subfolder/
2020-07-18 13:12:12,250 DEBUG: fetched: [(3,)]
2020-07-18 13:12:12,696 DEBUG: Adding 'subfolder/f6cf36bfd9b914e4_890986178457_00_122.png' to 'subfolder/.gitignore'.
2020-07-18 13:12:12,700 DEBUG: Path '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc' inode '224330060'
2020-07-18 13:12:12,701 DEBUG: fetched: []
2020-07-18 13:12:14,486 DEBUG: Path '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc' inode '224330060'
2020-07-18 13:12:14,487 DEBUG: fetched: []
2020-07-18 13:12:14,487 DEBUG: cache '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc' expected 'a2d0ac500784b02d3636c4b9075a08bc' actual 'a2d0ac500784b02d3636c4b9075a08bc'
2020-07-18 13:12:14,488 DEBUG: Path '/Users/florian/Downloads/test/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/subfolder/f6cf36bfd9b914e4_890986178457_00_122.png' inode '19290743'
2020-07-18 13:12:14,488 DEBUG: fetched: []
2020-07-18 13:12:14,523 DEBUG: Path 'subfolder/f6cf36bfd9b914e4_890986178457_00_122.png' inode '19290743'
2020-07-18 13:12:14,524 DEBUG: fetched: []
2020-07-18 13:12:14,524 DEBUG: {}
2020-07-18 13:12:14,524 DEBUG: Output 'subfolder/f6cf36bfd9b914e4_890986178457_00_122.png' didn't change. Skipping saving.
2020-07-18 13:12:14,524 DEBUG: Saving 'subfolder/f6cf36bfd9b914e4_890986178457_00_122.png' to '../../../../../tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc'.
2020-07-18 13:12:14,525 DEBUG: Path '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc' inode '224330060'
2020-07-18 13:12:14,525 DEBUG: fetched: [('1580290111000000000', '18671818', 'a2d0ac500784b02d3636c4b9075a08bc', '1595070734487113984')]
2020-07-18 13:12:14,525 DEBUG: cache '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/a2/d0ac500784b02d3636c4b9075a08bc' expected 'a2d0ac500784b02d3636c4b9075a08bc' actual 'a2d0ac500784b02d3636c4b9075a08bc'
2020-07-18 13:12:14,530 DEBUG: fetched: [(3,)]
2020-07-18 13:12:14,531 ERROR: unexpected error - [Errno 13] Permission denied: '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/.cache_type_test_file'
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/main.py", line 53, in main
    ret = cmd.run()
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/command/move.py", line 14, in run
    self.repo.move(self.args.src, self.args.dst)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/repo/__init__.py", line 36, in wrapper
    ret = f(repo, *args, **kwargs)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/repo/scm_context.py", line 4, in run
    result = method(repo, *args, **kw)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/repo/move.py", line 70, in move
    out.move(to_out)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/output/base.py", line 361, in move
    self.commit()
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/output/base.py", line 285, in commit
    self.cache.save(self.path_info, self.cache.tree, self.info)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/remote/base.py", line 1168, in save
    return self._save(path_info, tree, hash_, save_link, **kwargs)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/remote/base.py", line 1176, in _save
    return self._save_file(path_info, tree, hash_, save_link, **kwargs)
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/remote/base.py", line 1086, in _save_file
    elif self.tree.iscopy(path_info) and self._cache_is_copy(
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/remote/base.py", line 1128, in _cache_is_copy
    with self.tree.open(test_cache_file, "wb") as fobj:
  File "/usr/local/Cellar/dvc/1.1.10/libexec/lib/python3.8/site-packages/dvc/remote/local.py", line 74, in open
    return open(path_info, mode=mode, encoding=encoding)
PermissionError: [Errno 13] Permission denied: '/tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral/.cache_type_test_file'
------------------------------------------------------------

/Volumes/dvc is a read-only NFS mount. The issue looks very similar to #3510

$ more .dvc/config
[core]
analytics = false
remote = datasetmaster
['remote "datasetmaster"']
url = s3://scandit-datasets/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral
profile = datasets

$ more .dvc/config.local
[cache]
    dir = /tmp/dvc-data/eac-sot-generic-sm_960u1-1d-ean13-4k-small-30fps-no_occlusion-spiral
    type = symlink

Background on our setup:
DVC pushes images to S3. Our dataset engineers have the .dvc/config as pasted above. The same config is used for our ML training runs that are being executed on AWS.
Our ML developers need the same datasets, and so do the ML trainings that are executed onprem (we have our own GPUs; AWS is only used for peaks). Both these use cases have .dvc/config.local as pasted above (in addition to the same .dvc/config as everybody else). It points to a NFS share, where we sync the content of our S3 bucket. It is read-only to make sure it stays consistent.

Environment:
DVC version: 1.1.10
Python version: 3.8.4
Platform: macOS-10.15.5-x86_64-i386-64bit
Binary: False
Package: brew
Supported remotes: azure, gdrive, gs, http, https, s3, ssh, oss
Repo: dvc, git

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDid we break something?p3-nice-to-haveIt should be done this or next sprint

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions