Node-Red stopping process to early

Quite possibly it is something to do with the environment in which it is running, but without some clues from the app about why it is terminating then it is difficult to know what to do. Does the app log its progress somewhere? Or perhaps it has a runtime switch to output debug info.
It would be worth checking in syslog (assuming your system uses syslog). Run
tail -f /var/log/syslog
leave that running and trigger the exec in node red and see if anything appears.

Hat a talk to the developers of the program and unfortunately, I'd have to manually put in some debugging.

BUT:
It seems you where right with your guess on the delay in the script.

I edited it to be 100 seconds instead of 30 and also made the command to be:
cd /root/transfer/stock && sleep 20 && _JAVA_OPTIONS=-Xmx5g /root/transfer/stock/antrun.sh

Now I get the complete export. Wuhu!

If the 20 seconds delay you put in the command makes a difference then I wonder whether we have been on the wrong track completely.
Does the data that the java program is manipulating exist already or is the script in node-red triggered by something that says the data is now available? If it is the latter then try putting a 20 second delay node just before the exec node. Perhaps the java is being triggered too soon. Are you using a Watch node to trigger it for example?

Yeah it has to be a very silly error on my side: I did not include a delay after downloading the source file via FTP.
My assumption was, that "get" in the ftp node only provides an output when the complete file was loaded ...

That seems to me like a perfectly reasonable assumption, but apparently not. Yet another reason to avoid FTP.

It is a natural tendency when something doesn't work to assume it is the complex part that is failing, not the (supposedly) easy part. I should have thought of the possibility of a problem along those lines long before this point.

1 Like

Rather than a fixed delay you could look at lftp command that can help script ftp which you could then make part of the exec.that should be able to wait to complete before continuing to the next part of the && command

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.