tLogCatcher not catching child job errors

Five Stars

tLogCatcher not catching child job errors

tLogCatcher is not catching errors coming from a child job.

When a job is run it'll show all of the error messages coming from a child job in the Run Window, but it is not catched by tLogCatcher to email.
If we don't loop the child job, tLogCatcher is catching all error messages and emailing.

 

This is a master job:
tjava--->tloop--->tJavaflex--->tJava--->tRunjob--->tjava

NOTE: tRunjob has Die on child error and Use an independent process to run subjob selected

 

This is a child job:
tPrejob--->tRestclient--->tjson--->tSetGlobalvar

NOTE: tRestclient and tJson have Die on error selected

Community Manager

Re: tLogCatcher not catching child job errors

Are you using a tLogCatcher in your child job or expecting the logs to be caught by a tLogCatcher in your parent job? Can you show a screenshot of the jobs? That might help identify the issue

Five Stars

Re: tLogCatcher not catching child job errors

ParentJob.PNGParent JobChildJob.PNGChild Job

Eleven Stars

Re: tLogCatcher not catching child job errors

in tRunJob ,Please check if "Die on Child error" option is selected.

 

Regards
Abhishek KUMAR
Six Stars

Re: tLogCatcher not catching child job errors

I created a Talend 'joblet' for the log catcher as you are showing and drop that into each job, regardless whether it is a parent or child job.  In the case where a child job fails, I get two emails; one for the parent stating a 'child job has failed' and another for the child job which describes the exact error and I include the 'jobName' so that I know which job failed.    

Five Stars

Re: tLogCatcher not catching child job errors

If I'm not looping the child job then it does work.  Are you looping your child job and getting an email message?

Five Stars

Re: tLogCatcher not catching child job errors

Here is the screen shot when the child job is not looped it does email the message.  Do I need to add anything inside the loop in order to email the error message? Parentjob2.PNG

Six Stars

Re: tLogCatcher not catching child job errors

Mine is actually slightly different - I use the tFlowToIterate component from tLogCatcher to iterate each error to an email component - not using the tMap component.   I use the 'message' column from tLogCatcher and pass it to the email component, as the attached image shows in my setup. The code I use in the email's subject and message also shows in this image.  I used the tFlowToIterate component because multiple errors can happen within the same job itself and I needed get an email when each error 'incident' happens.  This works also for tWarn notices that you may want to see but not kill a job, like a using a tWarn to record a count above a certain threshold setting. 

Eleven Stars

Re: tLogCatcher not catching child job errors

if you want to stop in loop if child job fails
select ""Die on Child error".
Ideally failure will be captured by tLogCatcher.

if you want to continue in loop if child job fails

1)Donot select ""Die on Child error"
2) after tRunJob attach a runif condition and check ((Integer)globalMap.get("tRunJob_1_CHILD_RETURN_CODE")) !=0
3) attach it to tWarn

tWarn will be captured in tLogCatcher. Set Warning Message so that you can identify your details before sending mail.
Regards
Abhishek KUMAR
Five Stars

Re: tLogCatcher not catching child job errors

Abhishek,

 

I do want my child job to die and inside the tRunJob have checked an option Die on child error.  This is not working.  

Six Stars

Re: tLogCatcher not catching child job errors

A child job will fail if it actually fails internally so keep it set to stop if child job fails. Inside the child job, setup the tLogCatcher email to iterate errors to the email as my earlier attached image shows. When the child job fails, it should send you the code for the failure and also stop the parent job's run process as well. 

 

What I don't know about is your looping part. If you loop the child job from a parent job, how does the Parent job know when the Child job is has completed?  Will the parent job loop again 'before' the child job has completed?  If it does, you need to do some code like what akumar2301 stated so the Parent job doesn't run until the child job has completed. Otherwise, put all the components into a single job so when the loop happens, you can iterate through the 'whole' process for each loop that is done. 

 

Does this make sense? 

Six Stars

Re: tLogCatcher not catching child job errors

See my response that has the attached image.
Five Stars

Re: tLogCatcher not catching child job errors

Abhishek,

 

I'm new with Talend and wondering if I've done something wrong in my looping which is not catching the error message via tLogcather.  Do you have a sample loop job that will loop the child job and die once it reaches 5 tries? My child job is trying to make connection to CRM using tRestclient and if it tries for 5 times and it doesn't connect then die the job and email.  

Six Stars

Re: tLogCatcher not catching child job errors

Sorry for the late response. I don't have a setup that loops a 'child' job. The tLogCatcher example I shared will create and send an email every time a warning or error happens within the job itself.  I do not loop 'child' Jobs, I loop within a single job and pass the results to another job that handle the next process. I am sharing my resolution for the 'error handling' for any jobs in general.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads