Automation email failure

Hello!

We've been using the automation tools with Toad for DA for quite some time here without issue. That is, until we upgraded our desktops to Windows 7 recently. Since that upgrade, automation tasks will successfully send email as long as the user is logged in to the desktop. If the user logs out, the task will run, but any emails sent by the task fail.

Here is what the logs are showing when the emails fail to send. (The rest of the automation works as expected)

-- 8/6/2012 10:20:40 AM: test_automation.log: The socket object used by MailBee was unexpectedly closed. InnerException message follows: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
-- 8/6/2012 10:20:40 AM: test_automation.log: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
-- 8/6/2012 10:20:40 AM: test_automation.log: at a.ae.a(Exception A_0)
at a.ae.a(Byte A_0, Int32 A_1)
at a.ai.a(Byte A_0, Int32 A_1)
at a.v.ak()
at a.m.a(String A_0, Int32 A_1, Boolean A_2, Socket A_3, EndPoint A_4)
at a.m.x()
at a.f.l.x()
at a.f.m.x()
at a.f.l.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10)
at a.f.m.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10)
at a.f.e.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Int32 A_7, aw A_8, Boolean A_9, DataTable A_10, Int32 A_11, String A_12)
at a.f.n.a(String A_0, EmailAddressCollection A_1)
at a.f.n.a(Boolean A_0, String A_1, EmailAddressCollection A_2)
at a.f.n.a(Boolean A_0)
at MailBee.SmtpMail.Smtp.Send()
at Quest.Toad.Workflow.Activities.SendEmailActivity.SendMail(SmtpServer server, MailMessage email)
-- 8/6/2012 10:20:40 AM: test_automation.log: Email successfully sent
-- 8/6/2012 10:20:41 AM: test_automation.log: Email_1 - There were errors encountered sending the message. See the log file for details.

Everything worked flawlessly under Windows XP, so we're kind of at a loss as to what's happening. Any ideas?

-Eric

Open up the Windows Task Scheduler from your Accessories menu. How is this option set? “When running the task, use the following user account” . You can choose between “Run only when user is logged on” or “Run whether user is logged on or not”. I would experiement with that option first.

Debbie

P.S. I use win7 and have no issues with scheduled automation.

If that were the issue, then the task wouldn’t be firing off at all when the user is logged out. In my situation, the task is firing as intended but is unable to send an email when the user is not logged in.

I’ve also verified that the task settings are populated with a valid AD login, and the ‘Run only if logged on’ checkbox is not filled. Just to be safe.

-Eric

I have not run into this before. The email request is being sent but the connection to the server appears to be doing something different. Currently I do not have an answer to this. If I run into something I will let you know.

In the past we have always recommended that automation run when logged on.

Debbie

I started to experience this issue today. I am running windows 7, and the scripts were running just fine. In fact my scripts run early morning, and in the late afternoon, I was testing sending attached by email, and experienced this issue. I then setup a simple automation: Setting > Email > End. This failed with the following error:

System.InvalidOperationException

The workflow hosting environment does not have a persistence service as required by an operation on the workflow instance “26042858-3dee-4119-92fd-11f0eae8ea2f”.

Stack Trace:

at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)

at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)

at System.Workflow.Runtime.WorkflowInstance.Terminate(String error)

at Quest.Toad.Workflow.Engine.Cancel()

at Quest.Toad.Automation.AutomationForm.get_CanClose()

at Quest.Toad.Gui.MdiDocumentForm.OnClosing(CancelEventArgs e)

at System.Windows.Forms.Form.WmClose(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

In the log file, I found this:

at a.v.a(aq A_0)

at a.v.ai()

at a.m.a(String A_0, Int32 A_1, Boolean A_2, Socket A_3, EndPoint A_4)

at a.m.x()

at a.f.l.x()

at a.f.m.x()

at a.f.l.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10)

at a.f.m.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10)

at a.f.e.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Int32 A_7, aw A_8, Boolean A_9, DataTable A_10, Int32 A_11, String A_12)

at a.f.n.a(String A_0, EmailAddressCollection A_1)

at a.f.n.a(Boolean A_0, String A_1, EmailAddressCollection A_2)

at a.f.n.a(Boolean A_0)

at Quest.Toad.Workflow.Activities.SendEmailActivity.SendMail(SmtpServer server, MailMessage email)

This error stack is from the automation script being manually cancelled. Did you happen to have the background task window open and request to cancel the running automation process? Or try to close the automation window. We are not very graceful when canceling a running script.

Both. When trying to cancel via Windows Task Scheduler, nothing happened. TDP continued to run in the background.

Next, I ran the automation file manually. The automation log file stated the script completed, with email errors. When closing the tab, TDP said background processes running and asked if I want to cancel. I clicked cancel, and thus produced the error.

I tested this with another machine, and the same issue occurred.

However, I ran this script just now (8/15 2am), and it ran without errors. I did not do anything different or make changes to Windows or the script.

This is strange. It sounds almost like two automation scripts are running and one of them gets cancelled.

There is a known third party issue with .net 4.0. The issue is in the release notes of TDP 3.3. When shutting down a scheduled automation script TDP gets an unknown error. This is not the same issue you are getting But I would suggest applying the solution for this issue, which is to upgrade to .net 4.5.

Try that and let me know how that goes.