How to control triggering of email for the same error in ssis using event handlers? - ssis

I am using ssis event handler to trigger an email whenever an error occured in the entire package(PACKAGE+ONEEROR). Here number of emails triggered is equal to number of errors generated.How can I restrict it to one mail eventhough the same error occured 10 times.
Please suggest....

You have a few options. The problem with setting an ONERROR email at the package level is that it will send an email for each error the package encounters. This gets ugly if you have a deep level transform fail, which will error as it fails back up to the package level.
I suggest that you either:
1) Setup ONERROR events at the task level and remove the package level event. Usually this will be good enough. Most tasks will only have one error to report. Be careful with Data Flows, they can act in a similar fashion as the package level events.
2) Setup some sort of advance logging. I’ve seen this done several ways. I’ve seen some people setup Script tasks to log the errors (at the task level) to a variable, and then send a final email containing the variable in the body (at control flow level). I have also seen people call stored procedures (at the task level and package level) for each error that occurs. The sproc would log errors to the DB and allow the package to continue on to the next step/container. The logged errors can then be dumped into a csv and emailed as an attachment.
If you like your current setup, you can try changing the error properties for each container/task. I haven't ever done this, but I do know you can change the way tasks handle errors! I don't like this option because you would possibly be missing errors (maybe? kind of guessing).
update From another solution - If you want to keep your current email ONERROR and simply prevent certain errors from "bubbling" up and sending emails, you can follow this link to learn how to gracefully handle errors. You could prevent certain tasks errors from reaching your ONERROR event at the package level. good luck.

Related

Exception handling with Realbrowserlocusts

In using realbrowserlocusts class it appears that I'm limited in any exception handling.
The only reference that partially works is: self.client.wait.until(EC.visibility_of_element_located ....
In a failed condition where the element is not found the script simply starts over again. With the script I'm working with I need to maintain a solid session state; I need to throw and exception(report an error), log the user out and then let the script start over again. I've been testing out the behavior with the locust.py script that Nick B. created with several approaches to "try, except" and they work running without realbrowserlocusts (selenium only) but with it the execution just stops.
Any examples would be greatly appreciated.
In its current format I've been able to run 3x the amount of a browser-based load per/agent/slave than our commercial tool. My goal is to replace it with a locust/selenium approach.
locust-plugins's WebdriverUser has a little bit better exception handling I think. A failure to find an element will log a failed request and if you use RescheduleTaskOnFail (as in the the example) it will restart the task when that happens.
https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/webdriver_ex.py

Sending email notification on error using SSIS

I am currently implementing Send Email notification on error in my SSIS package. It currently works. Just want to check if this is the right way of doing it.
If you want to trigger your mail task when any error occurs, consider the "Event Handlers".
This SimpleTask article provides a very good overview of the event handlers
https://www.red-gate.com/simple-talk/sql/ssis/ssis-event-handlers-basics/
SSIS event handlers are the simplest means of turning an SSIS script into a reliable system that is auditable, reacts appropriately to error conditions, reports progress and allows instrumentation and monitoring your SSIS packages. They are easy to implement, and provide a great deal of flexibility.
Sample screen shot:
Using event handler provides some advantage - you need not connect each task's failure. The system will call your event handler for the error.
Also, note there are 2 event handlers of interest:
OnError
OnTaskFailed
https://learn.microsoft.com/en-us/sql/integration-services/integration-services-ssis-event-handlers
OnError event - This event is raised when an error occurs.
OnTaskFailed event - This event is raised by a task when it fails.
One thing to watch out for is that you event handler may be called multiple times depending on the number of errors.
I think there is no standard answer to this question. But here are some of the tips that I am be able to think of.
First, not very sure what kind of plain text you are trying to send out, if they do not have dynamic text body, you could put that send email task in the event handlers right to the Control flow, Data Flow... tab, and put that on error for specific tasks.
Second, I personally do not prefer to use Failure output, you may need to increase the number of MaximumErrorCount so that the package could executed successfully, but sometimes the real error might not be detected because together with error output, the total error numbers is still less than the threshold.
Third, if you are sending the same text, and you will schedule it as a job in SQL Server Agent, you could go to Notifications option page, set the Send Email, basically it will be informative.
Last but not least, the Send Mail task supports plain text only, not any formatting like email coded by html & CSS, if you need to take the formatting into consideration, that might not be your choice, you could use Script task using C# or creating html page by using XML statement from your SSMS and put into a stored procedure, then sent out the html by Database Mail, you will find this tool under Management folder in your SSMS.

Talend - Component that checks for any failure in multiple tRunjob

I did some search before posting this, couldn't find the talend component that will do the "Any failure" check mentioned in the image. any input is appreciated.
I have multiple tRunjobs which has to execute one after the other "on Subjob OK" but upon failure of any of the tRunjob, first the job has to catch the failure log and send a mail and then abort, I have tried to put this as a image, I'm particularly looking for the component "Any failure" which will check for any failure on any of the tRunjob. which component will do that?
I have used a similar approach in the past. This depends how the three jobs are called - I called them from one "handle all the stuff" job and used subjobs. E.g. this would lead to "Any Failure" is also the job which is calling the three subjobs.
Usually I only add a tLogCatcher in the main job which is calling the three other jobs. Then I make sure that the components in the three other jobs are set to throw errors if something goes wrong. All error handling would be done then in the main job.
Talend will not support a closed loop in your job.. So your best options are
--> create a joblet or use the same code for all 3 subjobs onsubjob error.
Or
--> use tPostjob and send an email based on the status of the each subjobs with tDie onsubjoberror.

SSIS Package level OnError sends two emails

I have a package that sends out two emails whenever a control flow element fails. For example, if the ExecuteSQL Task fails, the Package level OnError event handler fires two emails.
Is this a known issue? How do I get around this?
I can do this through database driven scripts, but essentially, I would like to handle the situation on SSIS itself. Thanks for any help.
Keep in mind that event handlers will raise events anytime the triggering action occurs. So, you're not guaranteed to only get one event using an event handler (with a few exceptions of course).
If you want to guarantee only one email then I would recommend not sending email via the OnError event and instead linking a 'Send Email Task' that is part of the control flow and connected to the ExecuteSQL task with a 'Failure Constraint'.
Or, you could also set a user variable equal to true in the OnError event and then send the email based on that with a 'On Completion' constraint mixed with an expression that checks the value of the Error user variable. That way, it doesn't matter how many times the OnError event raises as the task will only run if it was raised at least once.

Start up order for Oracle Forms

I have to modify an Oracle Form but cannot find my way to start.
What is the start up order for a standard form? That is which event, trigger etc will be called at form load, canvas load, etc. I assume that it is When-New-form-Instance but a cannot get it to stop at a break point on the first line of this trigger.
I am getting
FRM-40735 ON_ERROR trigger raised unhandled exception ORA-06508
Which I suspect means I do not have my environment set up correctly but I have done the same as others at this site. So I thought to start with debugging and try to identify which call is failing
PRE-FORM fires before WHEN-NEW-FORM-INSTANCE. Check what's defined in PRE-FORM trigger.
Also, your ON-ERROR trigger is giving a ORA-06508 error, so might want to check what program unit is being referred to in the ON-ERROR trigger
To get a start in trying to find the source of the error, try disabling custom code in forms. If the error does not persist when custom code is disabled, you'll have to start tracing through CUSTOM.PLL to find the source of the issue.