Skip to content

list: fails if a DVC-tracked directory is empty but present #6106

@shcheklein

Description

@shcheklein

Bug Report

Description

(.env) √ Projects/get-started-experiments % dvc list . data/fashion-mnist/prepared
ERROR: failed to list '.' - The path 'data/fashion-mnist/prepared' does not exist in the target repository
'/Users/ivan/Projects/get-started-experiments' neither as a DVC output nor as a Git-tracked file.

even though, this path does exist, and it is being tracked by DVC:

schema: '2.0'
stages:
  prepare:
    cmd: python3 src/prepare.py
    deps:
    - path: data/fashion-mnist/raw/
      md5: 8a31b1338b609cf1133d1df639de606c.dir
      size: 30878645
      nfiles: 4
    - path: src/prepare.py
      md5: 2c9ddd60ad065771628c58c618663050
      size: 3881
    params:
      params.yaml:
        prepare.remix: false
        prepare.remix_split: 0.2
        prepare.seed: 20210428
    outs:
    - path: data/fashion-mnist/prepared
      md5: c5095cd3e98121bc8d2bebe27d702ab5.dir
      size: 54951020
      nfiles: 2
...

Reproduce

git clone git@github.com:iterative/get-started-experiments.git
cd get-started-experiments
mkdir data/fashion-mnist/prepared
dvc list . data/fashion-mnist/prepared

gives:

ERROR: failed to list '.' - The path 'data/fashion-mnist/prepared' does not exist in the target repository '/Users/ivan/Projects/test-bug' neither as a DVC output nor as a Git-tracked file.

Expected

To see prepared.

Environment information

(.env) √ Projects/test-bug % dvc version
DVC version: 2.3.0+eb46c0
---------------------------------
Platform: Python 3.8.9 on macOS-10.15.6-x86_64-i386-64bit
Supports: All remotes
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: https
Workspace directory: apfs on /dev/disk1s1
Repo: dvc, git

Metadata

Metadata

Assignees

Labels

A: statusRelated to the dvc diff/list/statusbugDid we break something?p1-importantImportant, aka current backlog of things to doproduct: VSCodeIntegration with VSCode extension

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions