You could try using strace which should show you all the system calls that are being accessed when you run your command. Something like:
Code:
strace -o tracefile <your command>
Lots of output usually but the files on the system being accessed by your command will be written to the file: tracefile, and perhaps it is one of those that is messaging. Just an initial step. If you were able to get strace tracing files for both states, one where your command worked and one where the error appears, and compared them, that may be informative. The tracefile will end in 0 if there is no error, and -1 if there was an error.