Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-95142

After Upgrade , error encountered - ResourceNotFoundException: Unable to find resource '/langmacro.vm'

    XMLWordPrintable

Details

    Description

      Issue Summary

      After upgrading to 8.8.0 confluence fails to render the page, and users not able to login.

      The following Error occurs:

      2024-04-09 12:35:04,037 ERROR [http-nio-8090-exec-10 url: /500page.jsp] [confluence.util.profiling.ConfluenceSitemeshErrorDecorator] renderInternal Failed to render error decorator. Falling back to using no decorator
       -- traceId: 33d60c06d3c07d3b
      javax.servlet.ServletException: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/langmacro.vm'
      	at com.atlassian.confluence.util.profiling.ConfluenceSitemeshDecorator$ErrorThrowingErrorHandlingStrategy.handleException(ConfluenceSitemeshDecorator.java:288)
      

      Note that Custom layout decorator used, which uses ./langmacro.vm.
      However, this vm file is not present in the latest versions of Confluence causing the error.

      This is reproducible on Data Center: yes
      version - v8.8.1

      Pre-condition:

      Custom decorator that uses ./langmacro.vm

      Steps to Reproduce

      Confluence version - v8.5.3.
      1. Set up a Custom Layout decorator that uses ./langmacro.vm
      2. Upgrade to Confluence v8.8.1.
      – Confluence starts and is ready to serve.
      3. Try to log in.

      Expected Results

      Confluence login without issues/errors

      Actual Results

      Error is encountered.

      Error from Log:

      2024-04-09 12:35:04,027 INFO [http-nio-8090-exec-10 url: /500page.jsp] [atlassian.confluence.status.SystemErrorInformationLogger] writeToLog \nRequest Unique ID : 7629cfad-612e-4093-b3a7-618dfc6f480d\n--------------------------\nJVM Stats\n--------------------------\nxmx = 1073741824\nusedNonHeap = 483697024\navailableHeap = 424236528\navailableNonHeap = -1\nallocatedHeap = 1073741824\nfreeAllocatedHeap = 424236528\nmaxNonHeap = -1\navailablePermGen = 0\nmaxPermGen = -1\nmaxHeap = 1073741824\nusedHeap = 649505296\nusedPermGen = -1\nxms = 1073741824\n--------------------------\nRequest Information\n--------------------------\nURL: http://localhost:8090/500page.jsp\nScheme: http\nServer: localhost\nPort: 8090\nURI: /500page.jsp\nContext Path: \nServlet Path: /500page.jsp\nPath Info: null\nQuery String: null\n--------------------------\nAttributes\n--------------------------\njavax.servlet.forward.request_uri: /\njavax.servlet.forward.context_path: \njavax.servlet.forward.servlet_path: /index.action\njavax.servlet.forward.mapping: org.apache.catalina.core.ApplicationMapping$MappingImpl@1a7e3d42\norg.apache.catalina.AccessLog.RemoteAddr: 0:0:0:0:0:0:0:1\n__prepare_recursion_counter: 1\nstruts.actionMapping: noActionMapping\njavax.servlet.error.status_code: 500\nbrave.SpanCustomizer: SpanCustomizer(RealSpan(33d60c06d3c07d3b/33d60c06d3c07d3b))\n.KEY_velocity.struts2.context: com.atlassian.confluence.setup.struts.OutputAwareStrutsVelocityContext@17440428\ncom.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@56a67f75\norg.apache.struts2.dispatcher.filter.StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING: false\ncom.opensymphony.sitemesh.APPLIED_ONCE: true\natlas.webInterfaceContext: com.atlassian.confluence.plugin.descriptor.web.DefaultWebInterfaceContext@4f828658\ncom.atlassian.confluence.util.message.MessagesDecoratorFilter__already_filtered__: true\n__wrap_recursion_counter: 1\ncom.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter_already_filtered: true\natlassian.core.seraph.original.url: /500page.jsp\ncom.atlassian.labs.botkiller.BotKillerFilter: true\norg.apache.catalina.AccessLog.Protocol: HTTP/1.1\ncom.atlassian.gzipfilter.GzipFilter_already_filtered: true\nConfluence-Request-Time: 1712630103779\nstruts.valueStack: com.opensymphony.xwork2.ognl.OgnlValueStack@24fd36c7\ncom.atlassian.confluence.web.ConfluenceJohnsonFilter_already_filtered: true\nsitemesh.secondaryStorageLimit: -1\nstruts.request_uri: /\nconfluence.themecontext: com.atlassian.confluence.themes.ThemeContext@13af0334\norg.apache.catalina.AccessLog.ServerPort: 8090\njavax.servlet.error.message: Error rendering template for decorator root\njavax.servlet.error.servlet_name: default\norg.apache.tomcat.request.forwarded: true\nbrave.propagation.TraceContext: 33d60c06d3c07d3b/33d60c06d3c07d3b\nstruts.view_uri: /dashboard.action\nbrave.servlet.TracingFilter$SendHandled: true\norg.apache.tomcat.remoteAddr: 0:0:0:0:0:0:0:1\ncom.opensymphony.sitemesh.USINGSTREAM: false\norg.apache.catalina.AccessLog.ServerName: localhost\nB3-TraceId: 38b84c280bc28a\nloginfilter.already.filtered: true\njavax.servlet.jsp.jspException: java.lang.RuntimeException: Error rendering template for decorator root\njavax.servlet.error.request_uri: /\ncom.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true\ncom.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter: true\norg.apache.catalina.AccessLog.RemoteHost: 0:0:0:0:0:0:0:1\njavax.servlet.error.exception: java.lang.RuntimeException: Error rendering template for decorator root\nos_securityfilter_already_filtered: true\ncom.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true\n--------------------------\nParameters\n--------------------------\ncaused by: java.lang.RuntimeException: Error rendering template for decorator root\nat com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:161)\ncaused by: java.lang.RuntimeException: Error rendering template for decorator global\nat com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:161)\ncaused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/langmacro.vm'\nat com.atlassian.confluence.velocity.ConfigurableResourceManager.loadResource(ConfigurableResourceManager.java:386)\n
      2024-04-09 12:35:04,028 ERROR [http-nio-8090-exec-10 url: /500page.jsp] [atlassian.confluence.status.SystemErrorInformationLogger] logException Unhandled exception 7629cfad-612e-4093-b3a7-618dfc6f480d: Error rendering template for decorator root
       -- traceId: 33d60c06d3c07d3b
      java.lang.RuntimeException: Error rendering template for decorator root
      	at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:161)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      	at org.apache.velocity.Template.merge(Template.java:328)
      	at org.apache.velocity.Template.merge(Template.java:235)
      	at org.apache.struts2.views.velocity.result.VelocityResult.doExecute(VelocityResult.java:155)
      ..
      Caused by: java.lang.RuntimeException: Error rendering template for decorator global
      	at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:161)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      ..
      	... 708 more
      Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/langmacro.vm'
      	at com.atlassian.confluence.velocity.ConfigurableResourceManager.loadResource(ConfigurableResourceManager.java:386)
      	at com.atlassian.confluence.velocity.ConfigurableResourceManager.getResource(ConfigurableResourceManager.java:303)
      	at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
      	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:198)
      	at com.atlassian.confluence.setup.velocity.ProfilingParseDirective.render(ProfilingParseDirective.java:21)
      ..
      	... 723 more
      

      Workaround

      If you don't require the custom layouts anymore:
      You can drop the offending decorators from the DB table "decorator"
      The common issue decorators are:

      • decorators/admin.vmd
      • decorators/main.vmd
      • decorators/login.vmd

      For the login decorator you will need to remove it based on Customizing the Login Page

      If you want to keep your custom layout:

      Edit the Main layout decorator and perform following:
      Remove

      #parse ("/langmacro.vm")

      and replace

      <html #langAttr()>

      with

      <html lang="$action.getLanguageJs()">
      

      For Admin layout decorator you also need to replace:

      <html>

      with

      <html lang="$action.getLanguageJs()">
      

      For the login page decorator please follow the steps outlined at the bottom of the page: Customizing the Login Page

      Custom decorators can also be found in the DB table "decorator"

      Attachments

        Issue Links

          Activity

            People

              ephillips@atlassian.com Edward
              e2a594875e14 Sandeep Sahadevan
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: