Not able to push data of dependencies to the remote
See original GitHub issueBug Report
Description
I’m not able to push data of dependencies in the dvc.yaml to the remote.
Reproduce
…/dvc.yaml

$ dvc repro
$ dcv add ../../data/my_data.csv
$ dvc push ../../data/my_data.csv
Error: failed to push data to the cloud - ‘…/…/data/my_data.csv’ does not exist as an output or a stage name in ‘dvc.yaml’: Stage ‘…/…/data/my_data.csv’ not found inside ‘dvc.yaml’ file
Expected
my_data.csv is uploaded to the cloud successfully.
Environment information
- dvc 2.4.3
Output of dvc doctor:
DVC version: 2.4.3 (conda)
---------------------------------
Platform: Python 3.8.10 on macOS-10.15.3-x86_64-i386-64bit
Supports: http, https
Cache types: reflink, hardlink, symlink
Cache directory: apfs on /dev/disk1s5
Caches: local
Remotes: local
Workspace directory: apfs on /dev/disk1s5
Repo: dvc, git
Additional Information (if any):
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Can't push to remote branch, cannot be resolved to branch
Unable to resolve. Ran this command: git push --all -u. This got my Feature/Name branch to github, but still ...
Read more >How to Fix 'failed to push some refs to' Git Errors - Komodor
If you get a failed to push some refs to error, the main thing to do is git pull to bring your local...
Read more >push/pull: missing sshfs dependency on macOS #6629 - GitHub
ERROR: failed to push data to the cloud - URL 'ssh://' is supported but requires these missing dependencies: ['sshfs']. Please report this bug ......
Read more >Troubleshooting | Data Version Control - DVC
The most common cause is changes pushed to Git without the corresponding data being uploaded to the DVC remote. Make sure to dvc...
Read more >Force maven to fetch dependencies from remote - Seralahthan
Here the build failure occurs as maven tries to build from the partially fetched dependency cached in the local repository. Maven fetches updates...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Christoph-1 using the rules I suggested,
my_data.csvwill be ignored by the first ruledata/**.The subdirectory exclusion
!data/**/only applies to the subdirectory paths (which end in a trailing slash), and essentially just forces git to traverse into subdirectories (so that it can see the.dvcfiles. All files inside subdirectories will still be ignored due to the first rule.data/folder/my_data.csvdoes not match!data/**/sincemy_data.csvis not a directory.So the way the rules work together is:
Another way to think about it would be that these rules are equivalent to the following for
data/folder/:You can verify this behavior yourself using
git check-ignoreYou can see that only
.dvcfiles are excluded by these rules. My data file paths (fooandbar) remain ignored by the first rule.@Christoph-1 to properly exclude your
.dvcfiles you will need something likeThe issue is that git will not traverse into subdirectories of an ignored dir unless the subdirectory itself is also explicitly excluded with a
!rule. So in your example, git won’t traverse intodata/folderat all, since it is ignored bydata/*, and the!data/folder/my_data.csv.dvcexclusion will never be considered.