bupstash icon indicating copy to clipboard operation
bupstash copied to clipboard

Attach path to failed put errors

Open piegamesde opened this issue 2 years ago • 4 comments

My backup fails after some time with "bupstash put: Resource temporarily unavailable (os error 11)". This is not enough information for me to successfully debug the cause. I'd need to know which file it failed on, and during which operation.

piegamesde avatar Jan 20 '23 23:01 piegamesde

Yeah, at the very least it should be mentioning the path.

Any chance of getting an strace log to help track down the cause?

andrewchambers avatar Jan 21 '23 00:01 andrewchambers

My initial debugging plan rested on the assumption that this is some IO error, in which case knowing the file and maybe also the operation in code that failed should be enough to debug it. However, it looks like this error may also come from different operations, for example spawning threads, in which case I'll probably have to do some strace inspection. I'd like to avoid it if possible though, especially since I think that we should have those error messages anyways.

piegamesde avatar Jan 21 '23 10:01 piegamesde

Interesting, it could be hitting some resource limits.

andrewchambers avatar Jan 21 '23 10:01 andrewchambers

For the error handling, it looks like enabling the "backtrace" feature on the anyhow crate and then RUST_BACKTRACE=1 should be enough to get source information from all errors. Only thing left to test is if the error printing at the bottom of the main function also automatically makes use of that information.

~~For better or for worse, I can't reproduce my original error which prompted this investigation on master anymore. So it must have been fixed between 0.12 and 7082d772c3e7cafc330418a6e413219906c7ca93 somehow.~~

piegamesde avatar Feb 12 '23 17:02 piegamesde