Skip to content

Make dvc pull error message clearer when there is a downloading problem #10252

Open
@parmentf

Description

@parmentf

When using a webdav remote, and you don't provide the right credentials, the error provided by DVC is not clear:

$ dvc pull --allow-missing -v
2024-01-19 14:39:17,317 DEBUG: v3.39.0 (pip), CPython 3.9.18 on Linux-6.2.0-1018-azure-x86_64-with-glibc2.31
2024-01-19 14:39:17,318 DEBUG: command: /usr/local/bin/dvc pull --allow-missing -v
2024-01-19 14:39:18,440 DEBUG: Preparing to transfer data from 'https://webdav.example.com/dvc/files/md5' to '/dvc/.dvc/cache/files/md5'
2024-01-19 14:39:18,441 DEBUG: Preparing to collect status from '/dvc/.dvc/cache/files/md5'
2024-01-19 14:39:18,441 DEBUG: Collecting status from '/dvc/.dvc/cache/files/md5'
2024-01-19 14:39:18,443 DEBUG: Preparing to collect status from 'files/md5'
2024-01-19 14:39:18,443 DEBUG: Collecting status from 'files/md5'
2024-01-19 14:39:18,444 DEBUG: Querying 1 oids via object_exists
2024-01-19 14:39:18,535 WARNING: Some of the cache files do not exist neither locally nor on remote. Missing cache files:
md5: e86afa670ff4bc8199bbee0600deb77c
2024-01-19 14:39:18,541 DEBUG: failed to create '/dvc/annulled.csv' from '/dvc/.dvc/cache/files/md5/e8/6afa670ff4bc8199bbee0600deb77c' - [Errno 2] No such file or directory: '/dvc/.dvc/cache/files/md5/e8/6afa670ff4bc8199bbee0600deb77c'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/generic.py", line 330, in transfer
    _try_links(
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/generic.py", line 272, in _try_links
    _link(link, from_fs, from_path, to_fs, to_path)
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/generic.py", line 62, in _link
    func(from_path, to_path)
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/base.py", line 497, in reflink
    return self.fs.reflink(from_info, to_info)
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/local.py", line 166, in reflink
    return system.reflink(path1, path2)
  File "/usr/local/lib/python3.9/site-packages/dvc_objects/fs/system.py", line 91, in reflink
    src_fd = os.open(src, os.O_RDONLY)
FileNotFoundError: [Errno 2] No such file or directory: '/dvc/.dvc/cache/files/md5/e8/6afa670ff4bc8199bbee0600deb77c'

No means to know that it's a credential problem.

Using curl, I got a clearer message, saying that the user was not authorized (and a 401 HTTP error).

The webdav error should be used to forge a message stating that the user is not authorized.

See #10102 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    researchuiuser interface / interaction

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions