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:
NOTE: tRunjob has Die on child error and Use an independent process to run subjob selected
This is a child job:
NOTE: tRestclient and tJson have Die on error selected
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
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.
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?
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.
I do want my child job to die and inside the tRunJob have checked an option Die on child error. This is not working.
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?
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.
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.
The first 100 community members completing the Open Studio survey win a $10 gift voucher.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Test drive Talend's enterprise products.