`dvc list -R` invalidates repo path

Given the folder structure in my data/ folder:

nested_start
├── folder_1
│   ├── folder_a
│   │   ├── file_0.txt
│   │   └── file_1.txt
│   └── folder_b
│       ├── file_0.txt
│       └── file_1.txt
├── folder_2
│   ├── folder_a
│   │   ├── file_0.txt
│   │   └── file_1.txt
│   └── folder_b
│       ├── file_0.txt
│       └── file_1.txt
└── folder_3
    ├── folder_a
    │   ├── file_0.txt
    │   └── file_1.txt
    └── folder_b
        ├── file_0.txt
        └── file_1.txt

Generated by the following Python script:

import itertools

from pathlib import Path

start = Path("data", "nested_start")
start.mkdir(exist_ok=True, parents=True)

for f1, f2 in itertools.product(("1", "2", "3"), ("a", "b")):
    final_folder = Path(start, f"folder_{f1}", f"folder_{f2}")
    final_folder.mkdir(exist_ok=True, parents=True)

    for file_idx in range(2):
        with (final_folder / f"file_{file_idx}.txt").open("w") as fi:
            fi.write(f"{f1} {f2} {file_idx}\n")

After adding and pushing, I can list this folder with:

dvc list . data/nested_start

However, I cannot list it recursively.

$ dvc list -R . data/nested_start
ERROR: failed to list '.' - The path 'data/nested_start' does not exist in the target repository '.' neither as a DVC output nor as a Git-tracked file. 

Why does -R make my repository invalid?

1 Like

I can confirm this is happening on DVC 1.9.1 (Win). I opened https://github.com/iterative/dvc/issues/4875 for this, please subscribe, @Seanny123

2 Likes