Mac OS X: BatchExecutor returns wrong exit codes / status (0 instead of 4)

I have written a small shell-script executing a knime workflow. After the execution of the workflow the script checks exit codes. The knime BatchExecutor returns '0' although the console log reports

"INFO      main BatchExecutor     ========= Workflow did not execute sucessfully ============"

This problem is persistent on Mac OS X. Works fine under Linux.

If possible, how can this be fixed ?

Script excerpt:

echo "  Executing calculation...";
"${PATH_TO_KNIME}" -nosplash \
                   -nosave \
                   -reset \
                   -failonloaderror\
                   -application org.knime.product.KNIME_BATCH_APPLICATION \
                   --launcher.suppressErrors \
                   -workflowDir="${WORKFLOW_DIR}" \
                   -workflow.variable=input_file_list,"file:${TMP_FILE_LIST}",String \
                   -workflow.variable=result_file_path,"${TARGET_FILE}",String


# Checks exit status of knime workflow
RESULT=$?;
echo $RESULT;
if [ $RESULT -ne 0 ]; then
    echo ""; red;
    echo "! Execution of knime workflow failed. Aborting further execution."
    echo ""; noCo;
    exit 1;
else
    echo ""; green;
    echo "✓ Execution of knime workflow succeded. Results were written into:";
    echo "  ${TARGET_FILE}";
    echo ""; noCo;
    exit 0;
fi

Log excerpt:

  Executing calculation...
Launcher argument '--launcher.suppressErrors' ignored
Launcher argument '--launcher.library' ignored
Launcher argument '--launcher.suppressErrors' ignored
INFO 	 main BatchExecutor	 ===== Executing workflow /Users/fresal/Desktop/STUDIUM/_NO_DROP_BOX/PA - Sentiment Analysis/Code/knime/Production_Workflows/data_homer_-_Data_Preparation =====
WARN 	 main File Reader	 Can't access 'file:/home/fresal/PA_Sentiment_Analysis/Code/knime/Production_Workflows/data_homer_-_Data_Preparation/BLACK_BOX_TEST/test_file_list.tsv'. (/home/fresal/PA_Sentiment_Analysis/Code/knime/Production_Workflows/data_homer_-_Data_Preparation/BLACK_BOX_TEST/test_file_list.tsv (No such file or directory))
WARN 	 main File Reader	 Errors loading flow variables into node : Loading model settings failed, caught "IllegalArgumentException": Cannot create URL of data file from '' in filereader config
WARN 	 main File Reader	 Errors loading flow variables into node : Loading model settings failed, caught "IllegalArgumentException": Cannot create URL of data file from '' in filereader config
WARN 	 KNIME-Worker-1 CSV Writer	 File "/Users/fresal/Desktop/STUDIUM/_NO_DROP_BOX/PA - Sentiment Analysis/Data/data_lisa/classifier_predictions.tsv" exists, must not overwrite it (check dialog settings)
WARN 	 KNIME-Worker-0 CSV Writer	 File "/Users/fresal/Desktop/STUDIUM/_NO_DROP_BOX/PA - Sentiment Analysis/Data/data_lisa/classifier_predictions.tsv" exists, must not overwrite it (check dialog settings)
INFO 	 main BatchExecutor	 Workflow execution done Finished in 1 min, 15 secs (75977ms)
INFO 	 main BatchExecutor	 ========= Workflow did not execute sucessfully ============
0

✓ Execution of knime workflow succeded. Results were written into:
  /Users/fresal/Desktop/STUDIUM/_NO_DROP_BOX/PA - Sentiment Analysis//Data/data_lisa/classifier_predictions.tsv

 

On MacOS X the knime "executable" is in fact a shell script and the last command in the script is not the call to the java process. We can try to work around this for the next release.