Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Maybe a bug of PDI pdi-ce-6.0.1.0-386: errorcode = 0 always

  1. #1
    Join Date
    Apr 2016
    Posts
    5

    Question Maybe a bug of PDI pdi-ce-6.0.1.0-386: errorcode = 0 always

    PDI verion 5.4 have similar problem and the bug fixed in PDI 6.0.

    http://forums.pentaho.com/showthread...ce-5-4-0-1-130
    http://forums.pentaho.com/showthread...des-in-PDI-5-4

    and the version I used is PDI6.0.1, and this bug is fixed already.

    I create a simple job, which execute a non-exists shell script.
    I run a job with kitchen.sh, and log tell me it's failed.
    But, the exit code is still 0.

    I modify the end lines of spoon.sh as follw:
    --------------------------
    # ***************
    # ** Run... **
    # ***************
    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 "==========================="$_PENTAHO_JAVA
    echo "==========================="$EXIT_CODE
    # return to the catalog from which spoon.sh has been started
    cd $INITIALDIR

    exit $EXIT_CODE
    --------------------------

    execute this job with kitchen.sh , and Logs as follows:

    2016/04/05 17:43:19 - test_not_exist_shell - 开始执行任务
    2016/04/05 17:43:19 - test_not_exist_shell - exec(0, 0, START.0)
    2016/04/05 17:43:19 - START - Starting job entry
    2016/04/05 17:43:19 - test_not_exist_shell - 开始项[Shell]
    2016/04/05 17:43:19 - test_not_exist_shell - exec(1, 0, Shell.0)
    2016/04/05 17:43:19 - Shell - Starting job entry
    2016/04/05 17:43:19 - Shell - Found 0 previous result rows
    2016/04/05 17:43:19 - Shell - Running on platform : Linux
    2016/04/05 17:43:19 - Shell - Executing command : /home/hduser/aa.sh
    2016/04/05 17:43:19 - Shell - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Error running shell [/home/hduser/aa.sh] : java.io.IOException: Cannot run program "/home/hduser/aa.sh": error=2, no such file or directory
    2016/04/05 17:43:19 - 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/hduser/aa.sh": error=2, no such file or directory
    2016/04/05 17:43:19 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.executeShell(JobEntryShell.java:578)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.execute(JobEntryShell.java:418)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.Job.execute(Job.java:730)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.Job.execute(Job.java:873)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.Job.execute(Job.java:546)
    2016/04/05 17:43:19 - Shell - at org.pentaho.di.job.Job.run(Job.java:435)
    2016/04/05 17:43:19 - Shell - Caused by: java.io.IOException: error=2, no such file or directory
    2016/04/05 17:43:19 - Shell - at java.lang.UNIXProcess.forkAndExec(Native Method)
    2016/04/05 17:43:19 - Shell - at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    2016/04/05 17:43:19 - Shell - at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    2016/04/05 17:43:19 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    2016/04/05 17:43:19 - Shell - ... 6 more
    2016/04/05 17:43:19 - test_not_exist_shell - 完成作业项[Shell] (result=[false])
    2016/04/05 17:43:19 - test_not_exist_shell - 任务执行完毕
    2016/04/05 17:43:19 - Kitchen - Finished!
    2016/04/05 17:43:19 - Kitchen - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Finished with errors
    2016/04/05 17:43:19 - Kitchen - Start=2016/04/05 17:43:03.882, Stop=2016/04/05 17:43:19.746
    2016/04/05 17:43:19 - Kitchen - Processing ended after 15 seconds.
    ===========================/usr/java/jdk1.8.0_73/bin/java
    ===========================0

    Because shell script doesn't exists, this job is failed. But, the return value is still 0.

    Is there anyone have the same problem.
    What shall I do?

    :(

  2. #2
    Join Date
    Aug 2015
    Posts
    313

    Default

    try with abort step, hope it will return different value rather than 0. (0 means success)

    link abort step to your sample job

  3. #3
    Join Date
    Apr 2016
    Posts
    5

    Unhappy try abort step, it still return 0 which means success.

    It doesn't work. :( My job as attachment.
    Name:  20160406102755.jpg
Views: 440
Size:  20.4 KB

    Logs as follow:

    2016/04/06 10:33:44 - test_not_exists_shell - Start of job execution
    2016/04/06 10:33:44 - test_not_exists_shell - exec(0, 0, START.0)
    2016/04/06 10:33:44 - START - Starting job entry
    2016/04/06 10:33:44 - test_not_exists_shell - Starting entry [Shell]
    2016/04/06 10:33:44 - test_not_exists_shell - exec(1, 0, Shell.0)
    2016/04/06 10:33:44 - Shell - Starting job entry
    2016/04/06 10:33:44 - Shell - Found 0 previous result rows
    2016/04/06 10:33:44 - Shell - Running on platform : Linux
    2016/04/06 10:33:44 - Shell - Executing command : /home/yezt/aaa.sh
    2016/04/06 10:33:44 - 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 10:33:44 - 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 10:33:44 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.executeShell(JobEntryShell.java:578)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.entries.shell.JobEntryShell.execute(JobEntryShell.java:418)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.Job.execute(Job.java:730)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.Job.execute(Job.java:873)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.Job.execute(Job.java:546)
    2016/04/06 10:33:44 - Shell - at org.pentaho.di.job.Job.run(Job.java:435)
    2016/04/06 10:33:44 - Shell - Caused by: java.io.IOException: error=2, No such file or directory
    2016/04/06 10:33:44 - Shell - at java.lang.UNIXProcess.forkAndExec(Native Method)
    2016/04/06 10:33:44 - Shell - at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    2016/04/06 10:33:44 - Shell - at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    2016/04/06 10:33:44 - Shell - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    2016/04/06 10:33:44 - Shell - ... 6 more
    2016/04/06 10:33:44 - test_not_exists_shell - Starting entry [Abort job]
    2016/04/06 10:33:44 - test_not_exists_shell - exec(2, 1, Abort job.0)
    2016/04/06 10:33:44 - Abort job - Starting job entry
    2016/04/06 10:33:44 - Abort job - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Aborting job.
    2016/04/06 10:33:44 - test_not_exists_shell - Finished job entry [Abort job] (result=[false])
    2016/04/06 10:33:44 - test_not_exists_shell - Finished job entry [Shell] (result=[false])
    2016/04/06 10:33:44 - test_not_exists_shell - Job execution finished
    2016/04/06 10:33:44 - Kitchen - Finished!
    2016/04/06 10:33:44 - 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 10:33:44 - Kitchen - Start=2016/04/06 10:33:34.207, Stop=2016/04/06 10:33:44.743
    2016/04/06 10:33:44 - Kitchen - Processing ended after 10 seconds.
    ---------------------------/usr/java/jdk1.8.0_73/bin/java
    ---------------------------0

    Quote Originally Posted by santhi View Post
    try with abort step, hope it will return different value rather than 0. (0 means success)

    link abort step to your sample job

  4. #4
    Join Date
    Apr 2016
    Posts
    5

    Default

    even I run a nonexistent job(kjb) with command line , it still return 0.
    why!!!

    Logs as follow:
    ------------------------------------------------------------------------------
    Apr 06, 2016 10:58:17 AM org.apache.cxf.endpoint.ServerImpl initDestination
    INFO: Setting the server's publish address to be /lineage
    Apr 06, 2016 10:58:18 AM org.apache.cxf.endpoint.ServerImpl initDestination
    INFO: Setting the server's publish address to be /marketplace
    10:59:15,786 ERROR [KarafLifecycleListener] Error in Blueprint Watcher
    org.pentaho.osgi.api.IKarafBlueprintWatcher$BlueprintWatcherException: Unknown error in KarafBlueprintWatcher
    at org.pentaho.osgi.impl.KarafBlueprintWatcherImpl.waitForBlueprint(KarafBlueprintWatcherImpl.java:89)
    at org.pentaho.di.osgi.KarafLifecycleListener$2.run(KarafLifecycleListener.java:112)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.pentaho.osgi.api.IKarafBlueprintWatcher$BlueprintWatcherException: Timed out waiting for blueprints to load: pentaho-big-data-api-initializer,pentaho-big-data-api-hdfs,pentaho-big-data-api-pig,pentaho-big-data-impl-vfs-hdfs,pentaho-big-data-kettle-plugins-pig,pentaho-big-data-impl-clusterTests
    at org.pentaho.osgi.impl.KarafBlueprintWatcherImpl.waitForBlueprint(KarafBlueprintWatcherImpl.java:77)
    ... 2 more
    Processing stopped because of an error:
    Unable to load the job from XML file [/home/yezt/Downloads/test_not_exists_shell0.kjb]
    Unable to read file [file:///home/yezt/Downloads/test_not_exists_shell0.kjb]
    Could not read from "file:///home/yezt/Downloads/test_not_exists_shell0.kjb" because it is not a file.
    ERROR: Kitchen can't continue because the job couldn't be loaded.
    ---------------------------/usr/java/jdk1.8.0_73/bin/java
    ---------------------------0
    [yezt@Master ~]$
    [yezt@Master ~]$ /mnt/kettle/data-integration/kitchen.sh -file=/home/yezt/Downloads/test_not_exists_shell0.kjb -level=Debug

  5. #5
    Join Date
    Oct 2014
    Posts
    15

    Default

    If you are on a linux system the problem is the pipe
    "$_PENTAHO_JAVA" $OPT -jar "$STARTUP" -lib $LIBPATH "${1+$@}" 2>&1 | grep -viE "Gtk-WARNING|GLib-GObject|GLib-CRITICAL|^$"
    it is the grep command that returns the 0
    put the output from pentaho in a file, check the return code and then do the grep.

  6. #6
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Try changing:
    Code:
    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=$?

    to
    Code:
    if [ $OS = "linux" ]; then
    "$_PENTAHO_JAVA" $OPT -jar "$STARTUP" -lib $LIBPATH "${1+$@}" 2>&1 | grep -viE "Gtk-WARNING|GLib-GObject|GLib-CRITICAL|^$"
    EXIT_CODE=${PIPESTATUS[0]}
    else
    "$_PENTAHO_JAVA" $OPT -jar "$STARTUP" -lib $LIBPATH "${1+$@}"
    EXIT_CODE=$?
    fi
    Note that the EXIT_CODE=$? moves to before the end if (fi) statement.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.