Sending notifications on FAULT_OTHER - Start impossible tasks
search cancel

Sending notifications on FAULT_OTHER - Start impossible tasks

book

Article ID: 254646

calendar_today

Updated On:

Products

CA Automic One Automation CA Automic Workload Automation - Automation Engine

Issue/Introduction

There is a job that fails with FAULT_OTHER - Start Impossible other error.  Is there a way to capture this error or send via mail notification?

An example of a failing job might be:

JOBS object that uses:
:set &vara_name# = 'vara.sql.query'
:set &hnd# = prep_process_var(&vara_name#)
:process &hnd#
:  set &line# = get_process_line(&hnd#, 1)
:endprocess

And the vara.sql.query has an incorrect statement like:

select oh_columndoesnotexist from oh

The job will end with FAULT_OTHER - Start impossible.  Other error

The details will show:

U02012033 Query could not be executed: 'Invalid column name 'oh_columndoesnotexist'. (Client: '0100', Object: Ah_idnr='1111006'/Otyp='SCRI'/Name='SCRI.33261248', Line: '0000, Variable: '')'

Environment

Release : All

Resolution

Due to the way that the jobs are designed when they go into a "FAULT_OTHER - Start impossible" status, there's no additional processing once they've reached this status - technically the job or task doesn't fully start, so it also never ends.  Using the return code handling won't work to kick something off after.  

However, if another task is able to get the runid of the one that goes into a FAULT_OTHER status, it can pull in the error message seen.  For example, if the runid of one of the items that failed was 117566591, a script or notification object can use something like the following:

:set &runid# = '117566591'
!get the error number for the runid
:set &err_nr# = GET_STATISTIC_DETAIL(&runid#, 'LAST_ERR_NR')
!get the error detail for the runid - this will bring in the &01, &02 parameters for an error code/U message
:set &err_ins# = GET_STATISTIC_DETAIL(&runid#, 'LAST_ERR_INS')
!get the actual message - this will pull in error number and parameters from above and write them out fully
:SET &err_msg# = GET_MSG_TXT (&err_nr#,&err_ins#)
!print the full error message
:p &err_msg#

One possible way to put this into a workflow is to put a post condition on the job with something like:

IF [CHECK STATUS] task ended with status FAULT_OTHER
  THEN [START OBJECT] execute object CALL.MAIL.HTML.33261248 as alias '' with <PARAMETERS>. and do not wait for end
  FINALLY [ABORT] Abort Signal: failed FAULT_OTHER

Then in a notification object (CALL.MAIL.HTML.33261248 above), it can have the code from above, but with &UC_CAUSE_NR used for the runid.  So the process would have something like:

:set &runid# = &UC_CAUSE_NR
!get the error number for the runid
:set &err_nr# = GET_STATISTIC_DETAIL(&runid#, 'LAST_ERR_NR')
!get the error detail for the runid - this will bring in the &01, &02 parameters for an error code/U message
:set &err_ins# = GET_STATISTIC_DETAIL(&runid#, 'LAST_ERR_INS')
!get the actual message - this will pull in error number and parameters from above and write them out fully
:SET &err_msg# = GET_MSG_TXT (&err_nr#,&err_ins#)
And in the notification body, you could have something like:
<p>&err_msg#</p>


This way if the Job that ends with FAULT_OTHER is in a workflow and has this PostCondition on it, it will kick off the notification which uses &uc_cause_nr to pull in the runid of the job and then it will grab the error info and send it in the body of the email.