Page 1 of 1

Can't find outputs for job ...

Posted: Fri Nov 20, 2015 11:58 pm
by John.M.Dean
I'm plagued by this error. It usually takes some strange workarounds for me to get past it. Usually it's changing the case of a file extension, etc. I'm executing a PHP command which works perfectly from a command line. When trying to run it from Switch, it produces "Can't find outputs for job" error. The script converts a text file to several XML files. The XML files are in the tmp directory, as expected.

I've tried coding a directory which is not auto-managed to get around this. That produces no output. I'll keep trying to put duct tape and baling wire on it until works, but I'm just wondering what the correct way to do this might be.

Thanks in advance.

Re: Can't find outputs for job ...

Posted: Sun Nov 22, 2015 3:40 pm
by sander
Do you use Switch variables %1, %2 and %3 in your execute command arguments?

%1: the absolute path of the input file/job folder
%2: the absolute path of the output file/job folder (which does not yet exist) including filename and extension
%3: the absolute path of a folder (which does exist) in which output or temp files may be placed

Re: Can't find outputs for job ...

Posted: Mon Nov 23, 2015 7:25 pm
by John.M.Dean
Yes, I've tried making use of the %1, %2, %3 arguments in various combinations with changes in the PHP script. Either I get no output with no error or I get "Can't find outputs."

I'll post the fix as soon as I figure it out. It should be simple and obvious. I'm apparently over looking something small.

Thanks.

Re: Can't find outputs for job ...

Posted: Mon Nov 23, 2015 7:34 pm
by gabrielp
I actually just concatenate my command as a single string instead of using the %1, %2, and %3 arguments when using process.execute. I find it to be a little bit easier for me. Here's an example: https://github.com/dominickp/SwitchAWS/ ... 0Upload.js

Re: Can't find outputs for job ...

Posted: Mon Nov 23, 2015 8:36 pm
by John.M.Dean
Okay. I've got it, now. I had to pass %3 argument and include that path as part of the output file name. But the small bit that I was stumbling over was to deliver multiple files as output in one folder. My script breaks a web order email (which is converted to .txt by Switch) into the individual items within each email. I had to deliver that output of multiple xml files as one folder to make Switch happy.

Thank you for your help.

Subsequently, I cannot build an XML path because Switch is complaining that it expects ";" while parsing the XML. I'll look at how the download link in the XML is formatted. Special characters are another pitfall.

(follow up - htmlspecialchars() fixed me up, nicely)