Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous import stage disappears on import failure #3362

Closed
skshetry opened this issue Feb 19, 2020 · 3 comments
Closed

Previous import stage disappears on import failure #3362

skshetry opened this issue Feb 19, 2020 · 3 comments
Labels
bug Did we break something?

Comments

@skshetry
Copy link
Member

skshetry commented Feb 19, 2020

$ dvc import /path/to/existing/repo file
$ ls
file file.dvc
$ dvc import /path/to/not-existing/repo file
$ test -f file.dvc || echo $? # no files or import stages
1

Same thing happens when the repo is valid but the file does not exist.

@skshetry skshetry added the bug Did we break something? label Feb 19, 2020
@efiop
Copy link
Contributor

efiop commented Feb 19, 2020

@skshetry This issue affects any dvc command such as dvc add/run/import/import-url. The reason is that when you run the same command again, you are explicitly overwriting the dvc-file and if the operation fails we don't want to give you a false sense of successful operation. E.g. if you would run dvc checkout after that you won't run the risk of getting an old file and not even realising that.

@skshetry
Copy link
Member Author

skshetry commented Feb 2, 2021

@efiop, I think the behaviour should be more robust. Right now, I guess this is a limitation of the way we collect stages or build graph ( that could be solved by update/replace methods in repo.index with a trie?)

@skshetry
Copy link
Member Author

skshetry commented Jan 3, 2023

These days we fail with:

unexpected error - [Errno 17] File exists: 'file'

For --no-download case, we do end up overwriting as the file won't exist in the workspace which is preventing this from happening. It is not ideal, but closing for now, as the above mentioned issue is somewhat fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something?
Projects
None yet
Development

No branches or pull requests

2 participants