Re: [gscan2pdf-help] Exit status of user defined tools?
Brought to you by:
ra28145
|
From: Alistair G. <akg...@gm...> - 2017-03-14 16:58:19
|
On 14 March 2017 at 17:06, Alistair Grant <akg...@gm...> wrote: > Hi Jeff, > > On 14 March 2017 at 16:58, Jeff <jf...@po...> wrote: >> On 14/03/17 16:37, Alistair Grant wrote: >>> Is the exit status of user defined tools checked? And where does stderr go? >> >> No and nirvana, ATM. >> >> The trouble is that tools have all sorts of different ideas on what >> should be returned and what should end up in stderr. >> >>> I'm currently trying to get gscan2pdf running inside a docker image. >>> It appears to be mostly working, I can scan, delete pages, renumber, >>> save, etc., but attempting to running textcleaner as a user defined >>> task fails: >>> >>> DEBUG - Free space in /tmp/gscan2pdf-pcQB (Mb): 42126.60546875 (warning at 10) >>> INFO - textcleaner -e stretch -f 23 -o 6 -T >>> /tmp/gscan2pdf-pcQB/QZp0Rf3RmN.pnm /tmp/gscan2pdf-pcQB/lPP177XrQd.pnm >>> ERROR - Exception 425: improper image header >>> `/tmp/gscan2pdf-pcQB/lPP177XrQd.pnm' @ error/pnm.c/ReadPNMImage/282 >>> ERROR - Error reading /tmp/gscan2pdf-pcQB/lPP177XrQd.pnm: Exception >>> 425: improper image header `/tmp/gscan2pdf-pcQB/lPP177XrQd.pnm' @ >>> error/pnm.c/ReadPNMImage/282. >>> >>> The improper image header is raised because the output file, >>> lPP177XrQd.pnm, is 0 bytes long. >>> >>> If I copy and paste the textcleaner command in a separate shell it >>> succeeds, i.e. I can view lPP177XrQd.pnm successfully. >> >> It sounds to me that there is a race condition. i.e. textcleaner returns >> before the output file is written. >> >> I take it that it all works fine outside the Docker image? > > Yep, it was working in my previous environment (I've just wiped the > drive on my laptop and re-installed the OS, so I don't have access to > the old environment). > >> If so, it is going to be hard to debug. > > But this has reminded me of using wrapper scripts to debug, so I'll try that. > > Thanks for such a quick response. Just FYI: textcleaner assumes that the current working directory is writeable, and it wasn't inside docker. I'll leave the wrapper script in place that changes the working directory. Thanks again, Alistair |