dvc: Invalid permisions of /var/tmp/dvc/repo
Edited by @shcheklein : See the latest comments, need some research to support the latest platformdirs (?)
Bug Report
dvc ls: creates /var/tmp/dvc with incorrect permissions
Description
Since https://github.com/iterative/dvc/releases/tag/2.48.0 the dvc is using /var/tmp/dvc as a “git cache” for unix based operating systems.
When the /var/tmp/dvc does not exist the dvc creates site cache folder using os.makedirs with default 777 permissions, but these permissions are masked by UMASK (https://stackoverflow.com/a/5231994).
This can cause an unexpected behavior of dvc ls (an other commands) for multi-user environment where other users can not write to originally created site-cache folder
Reproduce
- remove site cache dir
rm -r -f /var/tmp/dvc - run
dvc ls dvc ls git@github.com:iterative/dvc-test.git - check permissions
ls -al /var/tmp/dvcor run 2) as a different user
Expected
I believe that the site cache dir should be created with permissions that allows other users to list dvc repositories.
Environment information
Centos8
╰─❯ dvc doctor
DVC version: 2.48.0 (pip)
-------------------------
Platform: Python 3.8.13 on Linux-4.18.0-408.el8.x86_64-x86_64-with-glibc2.2.5
Subprojects:
dvc_data = 0.43.0
dvc_objects = 0.21.1
dvc_render = 0.2.0
dvc_task = 0.2.0
scmrepo = 0.1.15
Supports:
http (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
https (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
s3 (s3fs = 2023.1.0, boto3 = 1.24.59)
Cache types: reflink, hardlink, symlink
Cache directory: xfs on /dev/md0
Caches: local
Remotes: s3
Workspace directory: xfs on /dev/md0
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/8e5a699173beb5035173f8252c5bcbec
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 23 (8 by maintainers)
Commits related to this issue
- repo: create site_cache_dir with proper perms Fixes #9184 — committed to efiop/dvc by efiop 4 years ago
- repo: create site_cache_dir with proper perms Fixes #9184 — committed to iterative/dvc by efiop 4 years ago
Just encountered this issue; downgrading from
platformdirs-3.11.0toplatformdirs-3.10.0fixed it for me 👍Got the same error today
Since
platformdirs==3.11.1no longer exists on pypi https://pypi.org/project/platformdirs/#history , downgradeplatformdirsto3.10.0works for me@VK-T So does
pip checkshow any problems with it? Make sure you run in the same env that dvc is installed in.We require
platformdirs<4,>=3.1.1per https://github.com/iterative/dvc/blob/dad464285e3f107c9e4ccc6e0b82672578037afb/pyproject.toml#L54I’ve tried to delete the
/var/tm/dvcand list dvc files again and everythings seems to be working as expected. 👍Same issue.
hey @anunayasri ,let’s close it then and wait for someone to share the exact environment where we can reproduce it.
@VK-T Check
pip check, you likely have a newerplatformdirsinstalled that we don’t support yet.