Upgrade to 11 - An error occurred while executing an automation

Getting the error below in 11.1.1.10427

UnknownException: An error occurred while executing an automation. (An error occurred while trying to render a widget. Details of the issue were logged for review by the administrator.) ---> UnknownException: An error occurred while rendering the 'Execution' script for the automation '[Points] Downloading a media file (When a media file is downloaded)' (fec7df609edf44d189900dc139e7d8ff) (An error occurred while trying to render a widget. Details of the issue were logged for review by the administrator.) ---> Telligent.Evolution.ScriptedContentFragments.Model.JavaScriptException: Line 1, Column 133: TypeError: Author is undefined at call(Jint.Parser.Ast.ThisExpression) @ 0:1 ---> Jint.Runtime.JavaScriptException: Author is undefined at Jint.Engine.Execute(Program program, JintCallStack callStack) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.ExecuteJavascript(JavascriptExecutionContext context, String resourceName, DateTime sourceLastModifiedDateUtc, Func`1 getSource, ScriptLanguage parentLanguage) --- End of inner exception stack trace --- at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.ExecuteJavascript(JavascriptExecutionContext context, String resourceName, DateTime sourceLastModifiedDateUtc, Func`1 getSource, ScriptLanguage parentLanguage) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.<>c__DisplayClass46_1.<RenderScriptInternal>b__0() --- End of inner exception stack trace --- at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.<>c__DisplayClass46_1.<RenderScriptInternal>b__0() at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentOutputCachingService.Get(ConfiguredAutomation configuredAutomation, Func`1 getRenderedOutput) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.RenderScriptInternal(ConfiguredAutomation configuredAutomation, IPropertyTemplateOptions propertyOptions, String templateName, ScriptLanguage language, Nullable`1 cancellationToken, String friendlyTemplateName, IDictionary`2 additionalContext) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.RenderScript(ConfiguredAutomation configuredAutomation, Nullable`1 cancellationToken) at Telligent.Evolution.Platform.Automations.Implementations.AutomationExecutionService.<>c__DisplayClass10_0.<Execute>b__0() at Telligent.Evolution.Api.Services.UserService.RunAsUser(Action a, String username, Nullable`1 userId, Nullable`1 membershipId) at Telligent.Evolution.Platform.Automations.Implementations.AutomationExecutionService.Execute(TextWriter writer, ConfiguredAutomation configuredAutomation, AutomationTriggerContext triggerContext, Nullable`1 cancellationToken, Boolean throwExceptions) --- End of inner exception stack trace --- at Telligent.Evolution.Platform.Logging.ExceptionHelper.Handle(Exception ex, String message, CSExceptionType type) at Telligent.Evolution.Platform.Automations.Implementations.AutomationExecutionService.Execute(TextWriter writer, ConfiguredAutomation configuredAutomation, AutomationTriggerContext triggerContext, Nullable`1 cancellationToken, Boolean throwExceptions) at Telligent.Evolution.Platform.Automations.Implementations.AutomationExecutionService.<>c__DisplayClass11_1.<Initialize>b__0(Object arguments) at Telligent.Evolution.MediaGalleries.Internal.File.Implementation.MediaEventExecutor.OnDownload(MediaGalleryPost media, Int32 userId) at Telligent.Evolution.MediaGalleries.Plugins.WidgetApi.Media.Download(Int32 mediaId) 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.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at NVelocity.Runtime.Parser.Node.ASTMethod.Execute(Object o, IInternalContextAdapter context) at NVelocity.Runtime.Parser.Node.ASTReference.Execute(Object o, IInternalContextAdapter context) at NVelocity.Runtime.Parser.Node.ASTReference.Render(IInternalContextAdapter context, TextWriter writer) at NVelocity.Runtime.Parser.Node.ASTBlock.Render(IInternalContextAdapter context, TextWriter writer) at NVelocity.Runtime.Parser.Node.ASTIfStatement.Render(IInternalContextAdapter context, TextWriter writer) at NVelocity.Runtime.Parser.Node.SimpleNode.Render(IInternalContextAdapter context, TextWriter writer) at NVelocity.Template.Merge(IContext context, TextWriter writer) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.<>c__DisplayClass38_1.<RenderScriptInternal>b__0() at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentOutputCachingService.Get(ScriptedContentFragment fragment, String cacheKey, Boolean cacheable, Func`1 getRenderedOutput) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.RenderScriptInternal(ScriptedContentFragment contentFragment, NameValueCollection parameters, IPropertyTemplateOptions propertyOptions, String templateName, String internalId, String wrapperId, Boolean throwExceptions, String cacheKey, ScriptLanguage language, String friendlyTemplateName, IDictionary`2 additionalContext) at Telligent.Evolution.ScriptedContentFragments.Implementations.ScriptedContentFragmentRenderingService.RenderScript(ScriptedContentFragment fragment, NameValueCollection parameters, ScriptedContentFragmentScriptType scriptType, String internalId, String wrapperId, Boolean throwExceptions, String cacheKey) at Telligent.Evolution.ScriptedContentFragments.ScriptedContentFragment.RenderContent(TextWriter writer, ContentFragmentRenderOptions options) at Telligent.Evolution.Controls.FragmentWrapper.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at Telligent.Evolution.Controls.ContentFragmentContainer.RenderSortableConfiguredContentFragment(SortableConfiguredContentFragment fragment) at Telligent.Evolution.Controls.ContentFragmentContainer.BuildPage(LayoutType layoutType, Func`2 contentFragmentFunction, Boolean renderRegions, Boolean renderFragments, Boolean orderResponsively) at Telligent.Evolution.Controls.ContentFragmentContainer.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at Telligent.Evolution.Controls.ContentFragmentContainer.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) 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.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

  • It appears as there is an issue with a rule that was migrated to an automation.  You can work around this by going into automation studio and finding the automation for "[Points] Downloading a media file (When a media file is downloaded)" finding and changing the following code:

    context_v2_automationTrigger.Author.Id

    to:

    context_v2_automationTrigger.Arguments.Author.Id

    Of course, if you need further assistance, feel free to open a support case.  The following bug has been created to address this issue.

    TE-15317

  • There were a few other issues in that automation. An updated version is attached and can be imported in Automation Studio.

    WhenAMediaFileIsDownloaded-PointsAutomations-Automation.xml
    <automation name="${resource:Title}" version="11.0.0.0" description="${resource:Description}" id="fec7df609edf44d189900dc139e7d8ff" executeAsServiceUser="true" isSingleton="false" hostId="20621367a4734f92abef8dc33fa32a5b" trigger="Event" lastModified="2020-02-19 19:48:32Z" provider="31f486cc-03b5-42b6-b5df-81cdd976aa59">
    	<events>
    		<event key="media.download" />
    	</events>
    	<executionScript language="JavaScript"><![CDATA[if (core_v2_widget.GetBoolValue('ignoreIfOriginalAuthor', true) && context_v2_automationTrigger.Arguments.DownloaderId == context_v2_automationTrigger.Arguments.Author.Id)
    {
        // file author is the same as downloader
        return;
    }
    
    var userId = context_v2_automationTrigger.Arguments.DownloaderId;
    if (core_v2_widget.GetStringValue('awardTo', 'parent') == 'parent') {
        userId = context_v2_automationTrigger.Arguments.Author.Id;
    }
    
    context_v1_pointsAutomation.AwardPoints(userId, context_v2_automationTrigger.Arguments.ContentId, core_v2_media.ContentTypeId);]]></executionScript>
    	<configuration><![CDATA[<propertyGroup id="options" labelResourceName="Options">
        <property id="awardTo" labelResourceName="AwardTo" descriptionResourceName="AwardTo_Description" dataType="string" defaultValue="parent">
            <propertyValue labelResourceName="AwardTo_Parent" value="parent" />
            <propertyValue labelResourceName="AwardTo_Child" value="child" />
        </property>
        <property id="ignoreIfOriginalAuthor" labelResourceName="IgnoreIfOriginalAuthor" descriptionResourceName="IgnoreIfOriginalAuthor_Description" dataType="bool" defaultValue="true" />
    </propertyGroup>]]></configuration>
    	<languageResources><![CDATA[<language key="en-us">
      <resource name="AwardTo">Award points to</resource>
      <resource name="AwardTo_Child">Member downloading the file</resource>
      <resource name="AwardTo_Description">Select which member should receive points.</resource>
      <resource name="AwardTo_Parent">Media file author</resource>
      <resource name="Description">Awards points when a media file is downloaded.</resource>
      <resource name="IgnoreIfOriginalAuthor">Ignore downloads made by the media file author</resource>
      <resource name="IgnoreIfOriginalAuthor_Description">If enabled, downloads by the media file author will not cause points to be awarded.</resource>
      <resource name="Title">When a media file is downloaded</resource>
    </language>]]></languageResources>
    </automation>

  • Telligent Community
    0 Telligent Community 1 month ago
    TE-15317: Legacy rule migration causes error accessing invalid author entity. has been completed for 12.0.0, 11.1.2