Automation policy based on a report does not appear to run or Send emails
search cancel

Automation policy based on a report does not appear to run or Send emails

book

Article ID: 152251

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

An Automation policy does not appear to run at the time specified.

Here are some NS Log messages that could be seen:

Process: w3wp (7448)
Thread ID: 6
Module: w3wp.exe
Source: Altiris.Reporting.DataSource.RawSqlDataSource.Run
Description: RawSqlDataSource is running query:

Process: w3wp (7448)
Thread ID: 6
Module: w3wp.exe
Source: Altiris.Reporting.DataSource.RawSqlDataSource.Run
Description: RawSqlDataSource returned 0 rows in 'Table1' table

     ....This shows 0 rows even though the report that the automation policy is based off of returns MANY results

Module: w3wp.exe
Source: Altiris.Automation.AutomationPolicies.EvaluationRules.RunForNonEmptyDataEvaluationRule.EvaluateDataSource
Description: Evaluation rule ' (cb4d5492-6689-435b-853b-fa7866522a7d)' found no data to process.


Process: w3wp (7448)
Thread ID: 6
Module: w3wp.exe
Source: Altiris.Automation.AutomationPolicies.AutomationPolicy.Execute
Description: Automation policy 'NAME OF automation Policy' execution complete.


or


Process: AtrsHost (1320)
Thread ID: 26
Module: AtrsHost.exe
Source: Altiris.NS.Utilities.MailStdScripting.SendSMTPSync
Description: SMTP operation failed with the following details: Server:hubttorreui01; Port:25(A value of -1 indicates default); Username:UINVERSION\scaller; Error Message: Mailbox unavailable. The server response was: 5.7.1 Unable to relay.

( Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at Altiris.NS.Utilities.MailStdScripting.SendSMTPSync(AltirisMailMessage mailMsg) )
( Exception logged from:
   at Altiris.Diagnostics.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
   at Altiris.Diagnostics.Logging.EventLog.ReportException(String strMessage, String category, Exception exception)
   at Altiris.NS.Logging.EventLog.ReportException(String strMessage, Exception exception)
   at Altiris.NS.Utilities.MailStdScripting.SendSMTPSync(AltirisMailMessage mailMsg)
   at Altiris.TaskServerTasks.SendEmailTask.AltirisNSSendEmailHandler.SendEmail(String to, String cc, String bcc, String from, String fromName, String subject, String message, Boolean plainTxtFormat)
   at Altiris.TaskServerTasks.SendEmailTask.SendEmailServerTask.SendEmail(String to, String cc, String bcc, String from, String fromName, String subject, String message, Boolean plainTxtFormat, ParameterValueCollection inputParameters)
   at Altiris.TaskServerTasks.SendEmailTask.SendEmailServerTask.SendEmail(ParameterValueCollection input)
   at Altiris.TaskServerTasks.SendEmailTask.SendEmailServerTask.OnExecute(IServerTaskExecutionInstance instance)
   at Altiris.TaskManagement.ServerTasks.BaseServerTask.OnExecute(ITaskExecutionEngine engine, IServerTaskExecutionInstance instance, TaskInstanceRequest request)
   at Altiris.TaskManagement.ServerTasks.BaseServerTask.Execute(ITaskExecutionEngine engine, IBaseTaskExecutionInstance instance, TaskInstanceRequest request)
   at Altiris.TaskManagement.Common.Execution.Engine.TaskEngineExecutionThread.ExecuteTaskHandler()
   at Altiris.TaskManagement.ServerTasks.ServerTaskExecutionThread.ExecuteTaskHandler()
   at Altiris.TaskManagement.Common.Execution.Engine.TaskEngineExecutionThread.OnExecute(Object eventComplete)
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)
 )
( Extra Details:  Type=System.Net.Mail.SmtpFailedRecipientException Src=System )


or

Module: w3wp.exe
Source: Altiris.Automation.Web.AutomationPolicies.AutomationPolicyUIPage.HandleException
Description: Unexpected error in automation policies.

( Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
   at System.Text.StringBuilder.Append(String value)
   at System.IO.StringWriter.Write(String value)
   at System.Web.UI.HtmlTextWriter.Write(String s)
   at System.Web.HttpUtility.HtmlEncode(String s, TextWriter output)
   at System.Web.UI.HtmlTextWriter.WriteEncodedText(String text)
   at Altiris.Automation.AutomationPolicies.DataSources.TableHelper.RenderTableAsHtml(DataTable table)
   at Altiris.Automation.AutomationPolicies.DataSources.TableHelper.GetStandardTableFieldValue(DataTable table, OutputDataOption outputDataOption, String fieldName, Object context, Object& result)
   at Altiris.Automation.AutomationPolicies.DataSources.ReportDataSource.GetFieldValue(OutputDataOption outputDataOption, String FieldName, Object context)
   at Altiris.Automation.AutomationPolicies.EvaluationRules.RunForNonEmptyDataEvaluationRule.EvaluateDataSource(IAutomationPolicyDataSource dataSource, IActionDataSourceAdapter dsAdapter, ExecuteActionDelegate executeAction)
   at Altiris.Automation.AutomationPolicies.EvaluationRuleExecutor.EvaluateDataAndExecuteAction(IAutomationPolicyDataSource ds, IEvaluationRule evalRule, IActionDataSourceAdapter dsAdapter, IAction action)
   at Altiris.Automation.AutomationPolicies.AutomationPolicy.Execute(Object objExecutionContextData)
   at Altiris.Automation.AutomationPolicies.Triggers.TriggerBase.FireTrigger(Object objExecutionContextData)
   at Altiris.Automation.Web.AutomationPolicies.AutomationPolicyUIPage.btnTestNP_Click(Object sender, EventArgs e) )
( Exception logged from:
   at Altiris.Diagnostics.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
   at Altiris.Diagnostics.Logging.EventLog.ReportException(String strMessage, String category, Exception exception)
   at Altiris.NS.Logging.EventLog.ReportException(String strMessage, Exception exception)
   at Altiris.Automation.Web.AutomationPolicies.AutomationPolicyUIPage.HandleException(Exception ex)
   at Altiris.Automation.Web.AutomationPolicies.AutomationPolicyUIPage.btnTestNP_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.automationpolicyui_automationpolicy_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
   at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
   at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
 )
( Extra Details:  Type=System.OutOfMemoryException Src=mscorlib )

Environment

ITMS 7.x, 8.x

Cause

Automation policy datasource resolved query does not match the report's own resolved query.

Resolution

To resolve this type of issue:
1) Open the report you are using in the Automation Policy
2) Edit the report
3) Under the "Query Parameters" tab, ensure that all parameters have a default value
4) Under the "Report Parameters" tab, ensure that all parameters have a default value matching the default of the Query Parameters tab
5) Ensure that you have SMTP setup correctly in the NS
     ...You can check this by Navigating to Settings -> All Settings, Settings -> Notification Server -> Notification Server Settings -> Email Tab 
     ...Ensure that all the data is entered.
     ...Click the "Send Test Email" Button to ensure that you will receive emails


If the Automation Policy does not appear to run at this point, check for messages mentioning RawSqldataSource returned xxxx rows in 'Table1' table   or  Unexpected error in automation policies   or   System.OutOfMemoryException

     ...It looks like the NS Automation Engine + Task engine is not capable of handling extremely large numbers of returned events. In one case, a customer had a resultant set of over 50,000 rows which threw the System.OutOfMemoryException.

     ...If you have an automation policy datasource which is returning too many results, you will need to pare it down to small enough chunks that the NS can process it.

For additional information see these KB articles:

-KB 179645 "How to Send an E-mail with an Inline Report Using an Automation Policy" for information on how to configure an Automation policy to send email
-KB 178451 "How to setup a Notification Policy which will e-mail the results of a report?" for information on how to setup report Parameters correctly

 

 

Automation Policies