ANNOUNCEMENT: RAPIDMINER 9.1 BETA HAS BEEN RELEASED TODAY!   PLEASE DOWNLOAD AND GIVE FEEDBACK. ENJOY AND HAPPY RAPIDMINING!   -- @sgenzer – Community Manager

Command Line script just keeps running on RM Server

psp627psp627 Member Posts: 3 Contributor I
edited November 10 in Help
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.
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Moderator, Employee, Member Posts: 1,707   RM Engineering
    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,
    Marco
  • psp627psp627 Member Posts: 3 Contributor I
    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?
  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Moderator, Employee, Member Posts: 1,707   RM Engineering
    Hi,

    works fine for me.

    Process:

    <?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>
    Batch file:

    echo "test" > C:\users\XYZ\Desktop\test.txt
    Running that process locally or on RapidMiner Server produces a test.txt on my desktop.

    Regards,
    Marco
Sign In or Register to comment.