amiaopensource / ltopers

Bash scripts to manage LTO cartridges with LTFS
https://github.com/amiaopensource/ltopers
MIT License
39 stars 8 forks source link

Issues with error reporting vs error exiting #170

Closed privatezero closed 6 years ago

privatezero commented 6 years ago

We are attempting to write a tape with ltopers, and are running into a problem with it erroring and exiting during the rsync process. There appears to be a certain conflict with the way this is structured in that calling migratefies here using the _run_critical_event function from mmfunctions will cause writelto to fail should an rsync error occur (as is happening).

However, the subsequent parts of writelto such as here imply that it should continue processing and report the errors instead of killing the entire transfer.

This seems like something that should be resolved to one or the other?

dericed commented 6 years ago

I suspect that migratefiles isn't returning an error code, when it fails. I suggest that it should pass along the error code of the copying utility that it is using.

privatezero commented 6 years ago

It looks like migratefiles also will pass on an error code 1 due to it also using _run_critical_event, so it isn't directly passing on the rsync error code, but is passing its own? https://github.com/mediamicroservices/mm/blob/master/migratefiles#L47

Also, sorry for the maybe obvious question - but with the files being copied to tape in the first pass by gcp, what are the two passes of rsync via migratefiles trying to copy over?

privatezero commented 6 years ago

for reference, here is the thread of errors - rsync error 23-> migratefiles error 1-> writelto abort

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1209) [sender=3.1.3] 2018-03-08T03:26:56 - [migratefiles]Error: Running: "rsync -rtvPih --log-file=/Users/mac1/migrate.log --log-file-format=20180308-032616 '%f' %l '/Volumes/B00001/' /Volumes/HD2/LTO_DONE/ /Volumes/B00001/" gave an Error Code - 23 2018-03-08T03:26:56 - [migratefiles]The process ran into a critical error and can not proceed. 2018-03-08T03:26:56 - [writelto]Error: Running: "/usr/local/bin/migratefiles -o /Volumes/B00001 /Volumes/HD2/LTO_DONE/" gave an Error Code - 1 2018-03-08T03:26:56 - [writelto]The process ran into a critical error and can not proceed. mac1:~ mac1$

privatezero commented 6 years ago

It looks like this is a bug introduced in https://github.com/amiaopensource/ltopers/commit/d63047f363e7b1f2f4c634c65cce91d99ba3644b with the integration of DB reporting via mm by ahem me. I propose we switch back to the original way of calling migratefiles

retokromer commented 6 years ago

@privatezero Can this one be closed?

privatezero commented 6 years ago

yup yup! Should be resolved in https://github.com/amiaopensource/ltopers/pull/171

retokromer commented 6 years ago

Thank you!