Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-15166

the EXIT_CODE of spoon.sh is always be 0. (PDI 6.0.1)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Unknown
    • Resolution: Duplicate
    • Affects Version/s: 6.0.1 GA
    • Fix Version/s: None
    • Component/s: Job
    • Labels:
      None
    • Story Points:
      0
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Operating System/s:
      CentOS 6.x
    • Steps to Reproduce:
      Hide

      example I:
      1. run a nonexistent job(kjb) with command line, the return values is 0. and the log shows error.
      example II:
      1. create a job with three elements: "start", "shell", "success"
      2. the "shell" calls a nonexistent scripts
      3. run this job(kjb) with command line, the return values is 0. and the log shows error.
      example III:
      1. create a job with three elements: "start", "shell"
      2. the "shell" calls a nonexistent scripts
      3. run this job(kjb) with command line, the return values is 0. and the log shows error.

      Show
      example I: 1. run a nonexistent job(kjb) with command line, the return values is 0. and the log shows error. example II: 1. create a job with three elements: "start", "shell", "success" 2. the "shell" calls a nonexistent scripts 3. run this job(kjb) with command line, the return values is 0. and the log shows error. example III: 1. create a job with three elements: "start", "shell" 2. the "shell" calls a nonexistent scripts 3. run this job(kjb) with command line, the return values is 0. and the log shows error.

      Description

      I'm not sure this is a bug or not.
      In my opinion, EXIT_CODE = 0 means success, if thers's any error eccured druing the execution, the EXIT_CODE shouldn't be 0.

      The log of example I as follow:
      Apr 06, 2016 1:02:09 PM org.apache.cxf.endpoint.ServerImpl initDestination
      INFO: Setting the server's publish address to be /lineage
      Apr 06, 2016 1:02:10 PM org.apache.cxf.endpoint.ServerImpl initDestination
      INFO: Setting the server's publish address to be /marketplace
      Processing stopped because of an error:
      Unable to load the job from XML file [/home/yezt/Downloads/test_not_exists_shelllllll.kjb]
      Unable to read file file:///home/yezt/Downloads/test_not_exists_shelllllll.kjb
      Could not read from "file:///home/yezt/Downloads/test_not_exists_shelllllll.kjb" because it is not a file.
      ERROR: Kitchen can't continue because the job couldn't be loaded.
      ---------------------------0

      The log of example II & III as follow:
      2016/04/06 12:58:29 - test_not_exists_shell - Start of job execution
      2016/04/06 12:58:29 - test_not_exists_shell - exec(0, 0, START.0)
      2016/04/06 12:58:29 - START - Starting job entry
      2016/04/06 12:58:29 - test_not_exists_shell - Starting entry [Shell]
      2016/04/06 12:58:29 - test_not_exists_shell - exec(1, 0, Shell.0)
      2016/04/06 12:58:29 - Shell - Starting job entry
      2016/04/06 12:58:29 - Shell - Found 0 previous result rows
      2016/04/06 12:58:29 - Shell - Running on platform : Linux
      2016/04/06 12:58:29 - Shell - Executing command : /home/yezt/aaa.sh
      2016/04/06 12:58:29 - Shell - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Error running shell [/home/yezt/aaa.sh] : java.io.IOException: Cannot run program "/home/yezt/aaa.sh": error=2, No such file or directory
      2016/04/06 12:58:29 - Shell - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : java.io.IOException: Cannot run program "/home/yezt/aaa.sh": error=2, No such file or directory
      2016/04/06 12:58:29 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.executeShell(JobEntryShell.java:578)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.execute(JobEntryShell.java:418)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.Job.execute(Job.java:730)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.Job.execute(Job.java:873)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.Job.execute(Job.java:546)
      2016/04/06 12:58:29 - Shell - at org.pentaho.di.job.Job.run(Job.java:435)
      2016/04/06 12:58:29 - Shell - Caused by: java.io.IOException: error=2, No such file or directory
      2016/04/06 12:58:29 - Shell - at java.lang.UNIXProcess.forkAndExec(Native Method)
      2016/04/06 12:58:29 - Shell - at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
      2016/04/06 12:58:29 - Shell - at java.lang.ProcessImpl.start(ProcessImpl.java:134)
      2016/04/06 12:58:29 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
      2016/04/06 12:58:29 - Shell - ... 6 more
      2016/04/06 12:58:29 - test_not_exists_shell - Finished job entry [Shell] (result=[false])
      2016/04/06 12:58:29 - test_not_exists_shell - Job execution finished
      2016/04/06 12:58:29 - Kitchen - Finished!
      2016/04/06 12:58:29 - Kitchen - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Finished with errors
      2016/04/06 12:58:29 - Kitchen - Start=2016/04/06 12:58:18.970, Stop=2016/04/06 12:58:29.575
      2016/04/06 12:58:29 - Kitchen - Processing ended after 10 seconds.
      ---------------------------0

      I modify the spoon.sh in order to print EXIT_CODE.
      script as follow:

      1. ***************
      2. ** Run... **
      3. ***************
        OS=`uname -s | tr '[:upper:]' '[:lower:]'`
        if [ $OS = "linux" ]; then
        "$_PENTAHO_JAVA" $OPT -jar "$STARTUP" -lib $LIBPATH "${1+$@}" 2>&1 | grep -viE "Gtk-WARNING|GLib-GObject|GLib-CRITICAL|^$"
        else
        "$_PENTAHO_JAVA" $OPT -jar "$STARTUP" -lib $LIBPATH "${1+$@}"
        fi
        EXIT_CODE=$?
        echo "---------------------------"$EXIT_CODE
      4. return to the catalog from which spoon.sh has been started
        cd $INITIALDIR

      exit $EXIT_CODE

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              eksmile yezt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: