Execute Command - Shell script execution error
Moderators: chulett, rschirm, roy
Execute Command - Shell script execution error
Hi
I am executing a shell script from Execute command stage.
In General Tab --> Stage name
In Exec Command --> I have the unix path and the shell script
(/inbound/scripts/abc.sh)
That is the only stage I am using in the sequencer, when I run this I am getting the error like
JobControl (@Execute_Command_46): Command /inbound/scripts/abc.sh did not finish OK, reply = '127'
.JobControl (@Execute_Command_46): Controller problem: Unhandled failure (127) encountered executing command /inbound/scripts/abc.sh
--
Seq_Test1..JobControl (@Coordinator): Summary of sequence run
08:44:16: Sequence started (checkpointing on)
08:44:16: Execute_Command_46 (COMMAND /inbound/scripts/abc.sh) started
08:44:16: Execute_Command_46 finished, reply=127
08:44:16: Exception raised: @Execute_Command_46, Unhandled failure (127) encountered executing command /inbound/scripts/abc.sh
08:44:16: Sequence failed (restartable)
---
Seq_Test1..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
------------------------------------------------------
Please guide me what is this error and how can I fix this error
Regards
Prasad
I am executing a shell script from Execute command stage.
In General Tab --> Stage name
In Exec Command --> I have the unix path and the shell script
(/inbound/scripts/abc.sh)
That is the only stage I am using in the sequencer, when I run this I am getting the error like
JobControl (@Execute_Command_46): Command /inbound/scripts/abc.sh did not finish OK, reply = '127'
.JobControl (@Execute_Command_46): Controller problem: Unhandled failure (127) encountered executing command /inbound/scripts/abc.sh
--
Seq_Test1..JobControl (@Coordinator): Summary of sequence run
08:44:16: Sequence started (checkpointing on)
08:44:16: Execute_Command_46 (COMMAND /inbound/scripts/abc.sh) started
08:44:16: Execute_Command_46 finished, reply=127
08:44:16: Exception raised: @Execute_Command_46, Unhandled failure (127) encountered executing command /inbound/scripts/abc.sh
08:44:16: Sequence failed (restartable)
---
Seq_Test1..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
------------------------------------------------------
Please guide me what is this error and how can I fix this error
Regards
Prasad
You have 'Automatically handle activities that fail' turned on and your command did not return a zero result - so it was considered to have failed.
Either turn off that option or read in the Help how to use two triggers to convince the Sequence job that you are handling the 'failure'.
Either turn off that option or read in the Help how to use two triggers to convince the Sequence job that you are handling the 'failure'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks for the quick replychulett wrote:You have 'Automatically handle activities that fail' turned on and your command did not return a zero result - so it was considered to have failed.
Either turn off that option or read in the Help how to use two triggers to convince the Sequence job that you are handling the 'failure'.
I made the changes as you said (turn off that option 'Automatically handle activities that fail' ),
(1) Problem 1: I am still get the warning like this
Seq_Test1..JobControl (@Execute_Command_46): Command /inbound/scripts/abc.sh did not finish OK, reply = '127'
(2) Problem 2: one of the script ran succesfully with the warning above mentioned. I was running another script def.sh from ExecuteCommand stage, inside the script I am calling a small script that is not getting executed, does DS supports this type of operation.
Regards
Prasad
You will because your script sent a return code that is non-zero. All you did was turn off the fact that the job should automatically abort because of that. It should echo out whatever information you are trying to capture and send a return code of zero to indicate it was successful. Then check for Command Output in your Sequence.prasad111 wrote:(1) Problem 1: I am still get the warning like this
Seq_Test1..JobControl (@Execute_Command_46): Command /inbound/scripts/abc.sh did not finish OK, reply = '127'
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Yes I am using the return codeDSguru2B wrote:Handle all errors inside your script and exit explicity using a return code of 0 for successful and 1 unsuccessful.
[#parameters declatation
-
=
script continues
-------
when I am executing outside DS Job(UNIX command prompt) it executes fine, when I execute from Exec Command stage it creates a file FTPfile.list with 0 lines, it was suppose to get 20 lines
Please let me know if I have interpret your reply correctly, suggest me if I am doing something wrong
Regards
Prasad
Last edited by prasad111 on Tue Jun 19, 2007 10:02 am, edited 1 time in total.
Main ScriptDSguru2B wrote:I hope you are initializing all the variables ($) inside your script. The script looks ok. Post your entire script please.
Code: Select all
#!/bin/ksh
###############################################################################
Last edited by prasad111 on Tue Jun 19, 2007 10:02 am, edited 1 time in total.
It looks like thisDSguru2B wrote:At a glance the scripts look fine. Just make sure that both scripts have permission to be executed by your datastage id.
-rwxrwxrwx 1 atgr atgr 1239 Mar 9 16:38 filelist.sh
-rwxrwxrwx 1 atgr dstage 2478 Mar 12 09:51 Extract.sh
Extract is the main script and filelist.sh is the script called from the main script
do I need to change anything here, if yes plese let me know the command for it
thanks a lot
Well the permissions look fine. I am running out of ideas now. I guess its upto you. Put a bunch of echo statements in both your scripts. These statements will show up in the log. See how far it goes without breaking.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.