Page 1 of 1

Command sh did not finish OK, reply =

Posted: Wed Jun 30, 2010 5:59 pm
by shankar_ramanath
In one of the job sequences I use the "Execute Command" activity which is used to invoke a shell script.

The shell script returns two values depending upon the logic: 0 or 1.

In the job sequence I use triggers to branch the flow depending upon the return value.

When the shell script returns "1", the Director log reports a warning message.

I would like to get rid of the warning message. Since this is a job sequence, I am unable to demote/suppress the warning message.

Could you please let me know how to get rid of the warning message?

I realize that such warning messages are helpful. In this case, however, the return value is only used for branching the flow and hence the warning messages are superfluous.

Thanks,

Posted: Wed Jun 30, 2010 7:05 pm
by ray.wurlod
Create explicit triggers (custom triggers) to handle the explicit exit status values plus - if needed - an Otherwise trigger to handle unexpected values.

Posted: Wed Jun 30, 2010 7:15 pm
by chulett
As noted, handle it yourself and the automatically logged 'unhandled exception' message will go away.

Posted: Wed Jun 30, 2010 11:51 pm
by shankar_ramanath
Thanks Gentlmen.

I did as suggested and the warning message still persists. I am not sure what I am missing.

The shell script that I use returns a value $returnVal. $returnVal can be one of two values: 0 or 1.

In the Execute Command activity, I have two two branches: one with ReturnValue (Conditional) = 0 and the other with ReturnValue (Conditional) = 1.

When I compiled the initial post, the values were ReturnValue (Conditional) = 0 and Otherwise, which I have corrected now.

I still get the warning message, "Command sh did not finish OK, reply = '1'"

I do not get this warning for "ReturnValue = 0".

Please let me know how to get rid of the warning message.

Thanks again,

Posted: Thu Jul 01, 2010 12:38 am
by ray.wurlod
Uncheck the "automatically generate warnings" option in Job Properties.

Posted: Thu Jul 01, 2010 5:21 am
by chulett
Or just use the proper trigger conditions as posted earlier - Finished OK for the 0 link and Otherwise for the 1 link. It will then know that you are handling any errors and stop doing it itself.

Posted: Thu Jul 01, 2010 6:26 pm
by shankar_ramanath
chulett wrote:Or just use the proper trigger conditions as posted earlier - Finished OK for the 0 link and Otherwise for the 1 link. It will then know that you are handling any errors and stop doing it itself.
I tried what Craig had suggested by changing the Expression Type to "OK (Conditional)" - I could not find "Finished OK" but I think this is what was meant. The warning message "Command sh did not finish OK, reply = '1'" still persisted.

I tried what Ray suggested (Unchecked the box "Log warnings after activities finish with status other than OK) and the issue does not exist. I am a bit concerned about this approach because it happens at the job level (and not at the stage level), but I can live with it for now.

Many thanks to both of you,

Posted: Thu Jul 01, 2010 7:16 pm
by chulett
You need both links in order for this to work correctly and yes, you picked the right "OK" one. Run both into a Sequencer set to Any and then on to the next activity if either one is valid for the next step.