4

A ran into problem with DVC when some files are missing in remote. For example when I execute dvc pull I get the output

[##############################] 100% Analysing status.
WARNING: Cache 'c31bcdd6910977a0e3a86446f2f3bdaa' not found. File 'data/2.mp4' won't be created.
WARNING: Cache '77186c4596da7dbc85fefec6d0779049' not found. File 'data/3.mp4' won't be created.

dvc status gives me:

data/2.mp4.dvc:
    changed outs:
        not in cache:       data/2.mp4
data/3.mp4.dvc:
    changed outs:
        not in cache:       data/3.mp4

It seems that 2.mp4 and 3.mp4 where added under dvc control but dvc push has not been executed.

I have access to the original mp4 files and I have tried to add them back. I copied the mp4 files to the data folder and executed:

dvc remove data/2.mp4.dvc
dvc remove data/3.mp4.dvc

dvc add data/2.mp4 
dvc add data/3.mp4 

But there is no effect. How can I remove files from under dvc control and add them again?

Davide Fiocco
  • 5,350
  • 5
  • 35
  • 72
NShiny
  • 1,046
  • 1
  • 10
  • 19

1 Answers1

1

It seems I found a solution. I copied mp4 files to the data folder and executed commands:

dvc add data/2.mp4 
dvc add data/3.mp4

dvc push
NShiny
  • 1,046
  • 1
  • 10
  • 19
  • 2
    Did you intend to add file by file? It is possible to `dvc add {directory}`. – don_pablito May 23 '19 at 17:20
  • Glad that you've found a solution! I've noticed that you have dvc file per each mp4 file, which makes me think that you've added your data dir with dvc add data -R, instead of adding it as a whole with dvc add data. – Ruslan Kuprieiev May 23 '19 at 17:31
  • The difference between those is that when you are using dvc add data, dvc will track the whole directory, so if you add or remove anything to/from data, it will be able to detect that. Also, in that case only one dvc file is created for the whole directory. And if you are using dvc add -R data, it will go through the whole data directory recursively and will add every and each file to dvc creating a separate dvc file, so if you ever add a new file to data, dvc won't be able to tell. Which dvc version are you using, btw? We've recently added a warning to help avoid that confusion. – Ruslan Kuprieiev May 23 '19 at 17:31
  • 3
    @don_pablito Thank you for advice! I’ve intentionally added files separately because I’m total newbie with DVC and I wanted to learn how to deal with files first. – NShiny May 23 '19 at 17:41
  • @RuslanKuprieiev My DVC version is 0.40.7 – NShiny May 23 '19 at 18:51