Command Line script just keeps running on RM Server
psp627
New Altair Community Member
Using RM 5.3 and RM Server, I am trying to run a command line script using the Execute Program Operator.
In the process, with the first operator I change the directory which seems to work.
I then have a 2nd Execute Program Operator with the following syntax:
cmd /c start tableau refreshextract --config-file "C:\Users\905657\Documents\config.txt"
This script works if I type it directly into the command line, but when executed using RM, the process just runs and runs, never completing.
I have tried the same command in RM without the "start" at the beginning and when I do that it immediately fails.
'I'm a newbie at this- any help would be greatly appreciated.
In the process, with the first operator I change the directory which seems to work.
I then have a 2nd Execute Program Operator with the following syntax:
cmd /c start tableau refreshextract --config-file "C:\Users\905657\Documents\config.txt"
This script works if I type it directly into the command line, but when executed using RM, the process just runs and runs, never completing.
I have tried the same command in RM without the "start" at the beginning and when I do that it immediately fails.
'I'm a newbie at this- any help would be greatly appreciated.
0
Answers
-
Hi,
if you use cmd /c start, you are opening a new command line shell AND the process will not continue until that shell is manually closed by the user. That is obviously not feasible on a server so I suggest only using cmd /c command. Generally speaking, the "Execute Program" operator has to be used carefully on Windows machines, otherwise you might end up waiting forever.
FYI, RapidMiner 6.0.3 fixed a bug which caused stopping such a process on Windows to not do anything. With 6.0.3 and later you can just stop such a process straight away.
Regards,
Marco0 -
thanks,
when I run the same command only using cmd /c before the command it immediately fails with error code 1
I also created a .bat file and tried having RM Server run that but then it fails immediately (using just cmd /c) with error code 9,009.
Any other suggestions?
0 -
Hi,
works fine for me.
Process:
Batch file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.1.0">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.1.0" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="execute_program" compatibility="6.1.0" expanded="true" height="94" name="Execute Program" width="90" x="45" y="30">
<parameter key="command" value="cmd /c c:\users\XYZ\Desktop\test.bat"/>
<list key="env_variables"/>
</operator>
<connect from_op="Execute Program" from_port="out" to_port="result 1"/>
<connect from_op="Execute Program" from_port="err" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
Running that process locally or on RapidMiner Server produces a test.txt on my desktop.
echo "test" > C:\users\XYZ\Desktop\test.txt
Regards,
Marco0