Dvc: logger: output footer once when encountering multiple errors

Created on 30 Sep 2019  路  9Comments  路  Source: iterative/dvc

Version

DVC version: 0.60.1+beea7e.mod
Python version: 3.7.4
Platform: Linux-5.3.1-arch1-1-ARCH-x86_64-with-arch
Binary: False
Cache: reflink - True, hardlink - True, symlink - True
Filesystem type (cache directory): ('xfs', '/dev/mapper/vg-root')
Filesystem type (workspace): ('xfs', '/dev/mapper/vg-root')

Description

Sometimes, a command might output different errors:

ERROR: unable to create directory /cluster - [Errno 13] Permission denied

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
ERROR: failed to upload '.dvc/cache/d3/b07384d113edec49eaa6238ad5ff00' to 'ssh://mroutis@localhost/cluster/data/d3/b07384d113edec49eaa6238ad5ff00'
- [Errno 13] Permission denied

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
ERROR: failed to push data to the cloud - 1 files failed to upload

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

It is annoying to see every time the _Having any troubles?_ footer.

Desired output

ERROR: unable to create directory /cluster - [Errno 13] Permission denied
ERROR: failed to upload '.dvc/cache/d3/b07384d113edec49eaa6238ad5ff00' to 'ssh://mroutis@localhost/cluster/data/d3/b07384d113edec49eaa6238ad5ff00' - [Errno 13] Permission denied
ERROR: failed to push data to the cloud - 1 files failed to upload

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

Related files

  • dvc/logger.py
  • dvc/main.py
enhancement good first issue hacktoberfest p2-medium ui

Most helpful comment

@CodeGenki When talking about _donwload, the solution for it will involve solution for _upload, as they are both used by _process in https://github.com/iterative/dvc/blob/0.62.0/dvc/remote/local/__init__.py#L386 . So what we should do here is remove try: ... except Exception from https://github.com/iterative/dvc/blob/0.62.0/dvc/remote/base.py#L562 and rather than returning 1 there, just let the exception raise and then catch it _process. That way we can catch all the errors there, and process them only after all workers are done, so that we can gather up the summary about those errors and then raise DownloadError/UploadError as we do right now. Hope this makes sense. Please don't hesitate to ask questions :slightly_smiling_face:

All 9 comments

馃挴 @mroutis ! :)

For the record, that happens in Remote.download method, because we logger.error the error we are encountering. This only happens in multilti-threaded pull/push/status/etc. One possible solution would be to raise exception there and collect it in RemoteBASE._process to process that in a bulk later with 1 footer.

Hello! I would like to help with this if no one else is working on it

Hi @CodeGenki !

No one is working on this yet. Please feel free to give it a shot :slightly_smiling_face: Let us know if you have any questions.

Hello! I would like to help with this if no one else is working on it

Hi @CodeGenki , are you still working on this?

Yes, sorry it's taking a while. I'll try to get this done soon!

@efiop should the exceptions only be captured and processed for Remote.download or should it be more general and if so, would you recommend aollecting all of the exceptions to a new RemoteBASE method?

@CodeGenki When talking about _donwload, the solution for it will involve solution for _upload, as they are both used by _process in https://github.com/iterative/dvc/blob/0.62.0/dvc/remote/local/__init__.py#L386 . So what we should do here is remove try: ... except Exception from https://github.com/iterative/dvc/blob/0.62.0/dvc/remote/base.py#L562 and rather than returning 1 there, just let the exception raise and then catch it _process. That way we can catch all the errors there, and process them only after all workers are done, so that we can gather up the summary about those errors and then raise DownloadError/UploadError as we do right now. Hope this makes sense. Please don't hesitate to ask questions :slightly_smiling_face:

Hey @efiop, I didn't see any new PRs regarding this issue so I went ahead and created it myself, hope its fine with you, would be glad if you could take a look on that

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnabanita7 picture dnabanita7  路  3Comments

anotherbugmaster picture anotherbugmaster  路  3Comments

robguinness picture robguinness  路  3Comments

gregfriedland picture gregfriedland  路  3Comments

TezRomacH picture TezRomacH  路  3Comments