Page 1 of 1

Error calling routine DSSendmail

Posted: Thu Mar 16, 2006 12:49 pm
by kris007
Hi All,

I am getting the following error when my job is aborting in the sequence and I am not getting the email

Controller problem: Error calling DSRunJob(JOB_NAME), code=-2
[Job is not in the right state (compiled and not running)]
Will execute error activity: Exception_Handler
JobControl (DSSendMail): Parameter 4 ('[Job is not in the right state (compiled and not running)], Job aborted') does not start with a keyword
JobControl (@failure_email): Controller problem: Unhandled failure (-19) encountered calling routine DSSendMail

Error while executing error activity: Exception_Handler
I have ExceptionHandler---NotificationActivity-----Utilityaborttologroutine

in my Job sequence. Does this mean I am not using the Exception Handler stage properly.

Thanks
Kris.

Posted: Thu Mar 16, 2006 3:24 pm
by ray.wurlod
That's a tricky one, because your job did not abort. It couldn't be started, because it was not in a runnable state. Is your execution rule "reset if required, then run"?
There is also a problem with what you're feeding to the Notification Activity, but do solve the first problem first. After all, what has been fed to the Notification Activity is an artifact of the failure mode.

Posted: Thu Mar 16, 2006 5:26 pm
by kris007
Thanks Ray..I did take care of the problem. My concern was why I couldnt get the email..but as you said my job didnt abort..it just cudnt start.That answers my doubts.

Kris.

Posted: Thu Mar 16, 2006 9:09 pm
by rasi
Kris

Did you got any emails when the Sequence aborted first.?

Posted: Thu Mar 16, 2006 9:46 pm
by kris007
Siva..

yeah..I got the emails when the job aborted first. Then I restarted the job again but my JobActivity was not set to 'reset if required and run' and hence the error. Is there anything I need watch out for. Please let me know.

Kris

Posted: Thu Mar 16, 2006 10:22 pm
by rasi
Kris

I wanted to make sure that you received the first notification thro email.

"Reset if required and Run" is the one you need to watch. You will be fine once it is set.

Posted: Fri Mar 17, 2006 9:04 am
by kris007
Siva,

When I Abort the job by passing wrong values as parameters I am getting an email saying the Job is aborted. But I am still getting the following error.

Code: Select all

obControl (@UTILITYWARNINGTOLOG_routine): Controller problem: Unhandled failure (1) encountered calling routine DSX.UTILITYWARNINGTOLOG
Error while executing error activity: exception_handler
I am giving an simple text as an argument in the routine.

Thanks
Kris

Posted: Fri Mar 17, 2006 9:25 am
by kumar_s
At what stage the sequence is getting failed. And what is the trigger you use in the stage. One of the reason the Unhandled failure arised, when the failure trigger not been handled.

Posted: Fri Mar 17, 2006 9:52 am
by kris007
Its failing in the jobactivity stage. I am passing the wrong parameters deliberately to abort it and check it. I have two triggers.on OK and one Warnings.
Now, please correct if I am wrong. The error message

Code: Select all

JobControl (@UTILITYWARNINGTOLOG_routine): Controller problem: Unhandled failure (1) encountered calling routine DSX.UTILITYWARNINGTOLOG 
Error while executing error activity: exception_handler
is saying that the Routine UtilityWarningtoLog is being called or is it saying that it encountered problems calling that routine and hence it cant execute the Exception Handler.

Thanks
Kris.

Posted: Fri Mar 17, 2006 10:06 am
by ray.wurlod
It's telling you that you invoked UtilityWarningToLog (presumably in a Routine activity) and that UtilityWarningToLog returned 1 (which it does) and that you did not have a trigger to handle a return value of 1. With routines the rule is that the job sequence will report a failure unless the return value is 0, unless there is a specific handler for non-zero return values. It does the same with Execute Command activity; if the exit status is not zero a "failure" is detected. Since UtilityWarnToLog always returns 1 (inspect its code), either add a trigger to handle this, or clone the routine and change it so that it only returns 0.

Posted: Sat Mar 18, 2006 12:32 am
by kumar_s
Once I had such scenario from Comnand Activity, which replies 0 - Success, 1 - Warining, 2 - Error. Though I handled all the error code in the trigger section, it throwed me unhaldled error for reply 1. We manage to solve by giving 'Otherwise' trigger only for that condition.

Posted: Sat Mar 18, 2006 5:40 am
by ray.wurlod
It wasn't the Execute Command activity. Read the error message again. It was the Routine activity through which you invoked UtilityWarningToLog.

Posted: Sun Mar 19, 2006 2:09 am
by kris007
Thanks Ray. That helps. :)

Kris