AnsweredAssumed Answered

5.1 FreeMarker template error: The following has evaluated to null or missing:

Question asked by briant on Mar 21, 2017
Latest reply on Mar 22, 2017 by afaust

UPDATE:

1. Without changing anything at all, nor restarting any process, the emails were delivered last night successfully... We are both happy and concerned simultaneously.

2. The system was actually built 2+ years ago (Jan 2015) using Linux all in one installer for version 5.0.x, then the tomcat directory was relocated to a FreeBSD system (with native BSD tomcat, imagemagick, openoffice, swftools, etc), database moved into a separate dedicated server, and the lot upgraded to 5.1.  That was done a few months ago.

 

5.1 System built a few months 2 years ago. Working perfectly.

1 month ago we enabled multi tenancy, created 1 site, added 3 users, added content. System has been fine since the multi tenancy was enabled - ie:no errors logged.

Yesterday we removed a (testing) user from the site.

Last night the activity feed email failed (logs below).

The email ftl template from the log below ("workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9") is unchanged from default.

Line 53 is:

<#assign itemLink="<a href=\"${shareUrl}/page/site/${activity.siteNetwork?html}/${activity.activitySummary.page?html!\"\"}\">${activity.activitySummary.title?html!\"\"}</a>">

Col 130 starts here => ${activity.activitySummary.page?html.....

 

2017-03-21 00:00:00,476 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> {activity.activitySummary.pag [in template "workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9" at line 53, column 130]

Tip: [briant: removed, superfluous]

The failing instruction (FTL stack trace):
----------
==> ${activity.activitySummary.page?html!""} [in template "workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9" at line 53, column 128]
#assign itemLink = "\la href=\"\${sha... [in template "workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9" at line 53, column 49]
----------

Java stack trace (for programmers):
----------
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]

at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98)
at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115)
at freemarker.core.StringBuiltins$StringBuiltIn._eval(StringBuiltins.java:87)
at freemarker.core.Expression.eval(Expression.java:111)
at freemarker.core.DefaultToExpression._eval(DefaultToExpression.java:116)
at freemarker.core.Expression.eval(Expression.java:111)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.renderElementToString(Environment.java:1798)
at freemarker.core.StringLiteral.evalAndCoerceToString(StringLiteral.java:116)
at freemarker.core.StringLiteral._eval(StringLiteral.java:93)
at freemarker.core.Expression.eval(Expression.java:111)
at freemarker.core.Assignment.accept(Assignment.java:106)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:86)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:193)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:509)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:103)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:86)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.process(Environment.java:243)
at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:223)
at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:177)
at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:240)
at org.alfresco.repo.action.executer.MailActionExecuter$3.prepare(MailActionExecuter.java:958)
at org.alfresco.repo.action.executer.MailActionExecuter.prepareEmail(MailActionExecuter.java:1019)
at org.alfresco.repo.action.executer.MailActionExecuter.prepareEmails(MailActionExecuter.java:578)
at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:483)
at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy312.execute(Unknown Source)
at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:839)
at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:740)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:574)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:560)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:848)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy47.executeAction(Unknown Source)
at org.alfresco.repo.activities.feed.EmailUserNotifier.notifyUser(EmailUserNotifier.java:180)
at org.alfresco.repo.activities.feed.AbstractUserNotifier.notifyUser(AbstractUserNotifier.java:221)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2.processInternal(FeedNotifierImpl.java:386)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2.access$2(FeedNotifierImpl.java:381)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2$1$1.execute(FeedNotifierImpl.java:372)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2$1$1.execute(FeedNotifierImpl.java:1)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2$1.doWork(FeedNotifierImpl.java:368)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2$1.doWork(FeedNotifierImpl.java:1)
at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)
at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2.process(FeedNotifierImpl.java:363)
at org.alfresco.repo.activities.feed.FeedNotifierImpl$2.process(FeedNotifierImpl.java:1)
at org.alfresco.repo.batch.BatchProcessor$TxnCallback.execute(BatchProcessor.java:713)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.batch.BatchProcessor$TxnCallback.run(BatchProcessor.java:757)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

2017-03-21 00:00:00,512 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template

...

2017-03-21 00:00:00,628 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template

...

2017-03-21 00:00:00,630 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template

...

2017-03-21 00:00:00,790 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template

...

2017-03-21 00:00:00,792 ERROR [freemarker.runtime] [FeedNotifier1] Error executing FreeMarker template

...

 

No 'caused by' line. Same error repeats 6 times as shown.

 

First occurrence last night, the only likely change we can think of is the removal of the testuser account (who was previously receiving email activity feeds successfully, as were the other 2 users).

 

No emails were sent last night. This is a concern for us.

Outcomes