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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Message in Talend Stats "success" even if error occures

Hi folks,
I build a simple Job to test Logging to Database and sending Mails on Errors.

I provocated an Error in the job: The Table where the rows should be inserted does not exsist so there is a java.sql.BatchUpdateException when the DB Output Component is executed. "Abort on error" is checked.

Now the strange thing for me is, that in the Statistics-Table the status of the Job is "Success":

The Error gets logged correctly in the Logs-Table:

Now my questions:
1. Is this the wanted behaviour? Shouldn't the status of the Job in the Statistics Table be "failure"?
2. Is it possible to append the Error Message to the E-Mail which gets send on "Subjob Error"
Kind regards!
Labels (3)
11 Replies
Anonymous
Not applicable
Author

Hi,
Try to select the check box "Die on error" of the tProgresqlOutput"
Anonymous
Not applicable
Author

Hi,
Try to select the check box "Die on error" of the tProgresqlOutput"

I assume "Abbrechen bei Fehlern" is "Die on Error". It is checked...
Anonymous
Not applicable
Author

Hi machete,
Statistics table not only generates statistics for a job, but also for all the components. It is not necessary that the success message is related to complete job... pl check you would find some failure message as well..
thanks
vaibhav
Anonymous
Not applicable
Author

Hi,
Statistics table records details like begin Time, End Time which is generated by any job.
Logs table records the messages from Java Exception, tDie and/or tWarn (prerequisite: there must be an error in your job).
For your use case, your job is finished successfully with Java Exception.
2. Is it possible to append the Error Message to the E-Mail which gets send on "Subjob Error"

Do you want to send error message printed on console to email? If so, here is a global variable called ((String)globalMap.get("tPostgresqlOutput_1_ERROR_MESSAGE")). You can use it in tsendmail.
Here is a related forum https://community.talend.com/t5/Design-and-Development/resolved-Param%C3%A9trage-du-tSendMail/td-p/9..., hope it will be helpful for you.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
Statistics table records details like begin Time, End Time which is generated by any job.
Logs table records the messages from Java Exception, tDie and/or tWarn (prerequisite: there must be an error in your job).
For your use case, your job is finished successfully with Java Exception.
2. Is it possible to append the Error Message to the E-Mail which gets send on "Subjob Error"

Do you want to send error message printed on console to email? If so, here is a global variable called ((String)globalMap.get("tPostgresqlOutput_1_ERROR_MESSAGE")). You can use it in tsendmail.
Here is a related forum https://community.talend.com/t5/Design-and-Development/resolved-Param%C3%A9trage-du-tSendMail/td-p/9..., hope it will be helpful for you.
Best regards
Sabrina

Hi Sabrina,
that way the tMail Component would only show Error Messages of the specified component (tPostgresqlOutput_1).
But of course errors could occure somwhere else and I asked myself if there is a way to have something like a global generic error handler, which catches all errors of the job and puts them into the mail
But if I use tLogCatcher I don't get my log no longer in Database and File?! So my requirement is:
Have a job-wide error handler which is not tied to a specific component which logs Exceptions
1. In the logs Database Table
2. A log-file (in case db is not reachable)
3. Sends an E-Mail with the Exception Text
Kind regards
Kind regards!
Anonymous
Not applicable
Author

Hi,
Capture error logs to flat file in the tPreJob before starting the main job. Redirects all the contents to flat file..
Create independent job to read the file and if the contents length is> 0 send an email... Same file you can log to database table as well.
java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(logFile));
System.setErr(ps);
using fixedflow component, you can write the contents of each execution to DB table as BLOB/Text
Thanks
Vaibhav
Anonymous
Not applicable
Author

Hi,
You can use both Stat&log in job view/project setting and tlogcatcher component in your job design.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
You can use both Stat&log in job view/project setting and tlogcatcher component in your job design.
Best regards
Sabrina

Since I had some trouble with tLogCatcher I solved it that way:
On SubJobError I trigger tSendMail component which sends the logfile as attachment.
Just one more doubt I have: I tried to launch the job but my Database was not running. Therefor the job was cancelled with an Error (Could not connect to Database) before it could be executed. I think the databse connection for logging gets initialized before executing the job. But that way I would not recognize a problem with the job. Is there a way to catch and recognize these kinds of errors?
Anonymous
Not applicable
Author

Solved the main issue:
To have a "failure" in the stats log add a tDie component on "Component Failure" of the DB-Output.