Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

[resolved] Email notification in case of job failure

Hi,
I have a job that takes all data from oracle table and insert it in to ms sql table.
Ex: tOracleInput==>tmap==>tmsSqlOutput
Now, in case the job fails - due to any reason (say database went down or incorrect connection settings or any mismatch etc), I want to capture the error log in a email. I want to notify by sending email that the job has been failed with the error code attached in email body.
I tried 2 approaches using tSendMail component as given below:
Approach1 : tOracleInput==>tmap==>tmsSqlOutput==>onComponentError==>tSendMail
Approach2: tOracleInput==>tmap==>tmsSqlOutput==>onComponentError==>tDie
and tLogCatcher==>tSendMail
But I was not able to get the expected result with these 2 approaches.
Please help me out here!! Appreciate the responses with solutions.

Thanks
Xan
Labels (2)
13 Replies
Anonymous
Not applicable

Thanks for ur reply Shong. No I do not have any subjob but I have two email notification processes.
One tsendmail to send email to one group of people and other tsendmail to send email to different group of users.
I had to use 2 email process cz I want to send plain email to certain group and a log file attachment to another group. I hope this should not bother.
Later I tried deleting one of the tSendMail component hoping to see any change, but to my surprise, it is still sending 2 same emails.
Anonymous
Not applicable

Hi, I have exactly the same case, but input_row.message is null (in my case it's row18.message). 
   
{

tLogCatcher--main--tJavaRow
   |
onsubjobok
   |
tSendmail

uncheck the option 'die on error' on all the component, so that the job will throw the exception once fails and die.
on tJavaRow:
globalMap.put("errorCode", input_row.message);

on the message body of tsendmail:
"the error message is: "+(String)globalMap.get("errorCode")

uncheck the option 'die on error' on all the components.
}
Bu if I do, tLogCatcher--main--tSendmail, and inside of Email I do input_row.message, it works. There's problem getting a message inside of tJava.
Even this does send me null: System.out.println(insert_row.message);
Anonymous
Not applicable

Hi there and thanks for posting this.

 

It works but I also get 2 emails instead of one.

 

In one email the +(String)globalMap.get("errorCode")+ component is "null", and in the other it contains the actual error.

 

My setup is exactly as described:

 

tLogCatcher-->tJavaRow-->onSubJobOk-->tSendEmail

 

Thoughts?

Anonymous
Not applicable

Hi 

 

Am trying to get the error message notified through email and hence i had followed the below design

 

tinputdelimeter-->tmap--->toracleouptput

 

tlogcatcher --> tJavaRow1

     |

onsubjob ok

     |

tsendMail

 

Am using below script in tjavaRow :

globalMap.put("errorCode",row7.message);

 

in email below is the script :

"the error message is : "+(String)globalMap.get("errorCode")

 

Please help me here to get it resolved.Thanks in advance