TargetInvocationException Error

About 1-2 times per week, an automation task will kick off from task scheduler and a Toad error box will get displayed. The error is


TargetInvocationException
Exception has been thrown by the target of an invocation.

Stack Trace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

It doesn’t happen all the time and only seems to happen when automation tasks as kicked off. not when I run the automation tasks from within Toad. I’m running Toad 3.8.0.575.

Any idea what might be wrong?

Are you running more than one script at a time? If so, it could be because we are attempting to execute multiple scripts and Toad is set to only have one instance running.

Do you have this checkbox checked? Another thing you could do is separate your tasks to run by one minute, so that they don't all run at once.

If you are not running multiple scripts, may we ask what the task you are trying to run does, if it is a specific task.

I would also ask that you download the Beta. We made one change for automation scripts that might help.

Thanks Ryan. It’s possible that some scripts were overlapping. I spread them out a little bit more and enabled multiple copies to run. We’ll see if that fixes the problem.

From: Ryan Johnson [mailto:bounce-RyanJohnson@toadworld.com]

Sent: Wednesday, March 16, 2016 11:21 AM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] TargetInvocationException Error

RE: TargetInvocationException Error

Reply by Ryan Johnson

Are you running more than one script at a time? If so, it could be because we are attempting to execute multiple scripts and Toad is set to only have one instance running.

Do you have this checkbox checked? Another thing you could do is separate your tasks to run by one minute, so that they don’t all run at once.

If you are not running multiple scripts, may we ask what the task you are trying to run does, if it is a specific task.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point - General
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.

I love that error message. It sounds like something out of Dungeons and Dragons.

“Exception has been thrown by the target of an invocation”. It means a call to a subrountine had a problem in the subroutine and did not pass the specific error message to the parent routine. So all that you know is there was a problem. Not a very helpful error message.

This problem never went away unfortunately. I am running Toad 4.0 now. I checked all the scheduled tasks and they are running against 4.0. The error is still occurring occasionally. I don’t have tasks overlapping.

Any other thoughts?

Sorry for the late response!

I would like to ask, where are you getting this error message? Are you getting it from a UI pop up, or from logs?

I’m getting it as a UI pop up.

From: Ryan Johnson [mailto:bounce-RyanJohnson@toadworld.com]

Sent: Monday, September 12, 2016 10:22 AM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] TargetInvocationException Error

RE: TargetInvocationException Error

Reply by Ryan Johnson

Sorry for the late response!

I would like to ask, where are you getting this error message? Are you getting it from a UI pop up, or from logs?

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point Forum
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.

Can you open a support ticket. I would like our automation developer to look at this. Please give the support rep your automation script, latest automation log file and all dependent files such as txp, etc.

Next time it happens, I’ll create a support ticket. It doesn’t happen predictably. It also doesn’t show any problems in the automation log file though. The automation completes just fine, it’s just that the exception fires. It ‘feels’ like the exception occurs when Toad is shut down after the automation completes. Is there an application log in addition to the automation log? That might be where the exception is captured.

From: Debbie Peabody [mailto:bounce-Debbie_Peabody@toadworld.com]

Sent: Monday, September 12, 2016 10:51 AM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] TargetInvocationException Error

RE: TargetInvocationException Error

Reply by Debbie Peabody

Can you open a support ticket. I would like our automation developer to look at this. Please give the support rep your automation script, latest automation log file and all dependent files such as txp, etc.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point Forum
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.

We do have an ExceptionTrace.log file within the Application Data directory. You can get to it by going to Help->About, and clicking the link for Application Data directory.

I created SR Number:3657816 this morning. The log files show the automation completing correctly, but the ApplicationTrace log shows the exception after the automation completes.

Hello dfjelstul,

Thank you for the SR and the relevant data attached - it helped me with identifying the potential root cause.

However before I will implement any code changes I need to ask you to try out the latest BETA of TDP 4.0.1 where since 3.8 there is a huge amount of changes thus your problem definition might be changed - If you will encounter any problems within we will investigate from there and If the problem still occurs then I will be able to implement the potential fix afterwards.

Thanks for understanding,

Martin