Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-34322

Code Macro broken on some OnDemand instances since 5.5-OD-28

    XMLWordPrintable

Description

    NOTE: This bug report is for Confluence Cloud. Using Confluence Server? See the corresponding bug report.

    When visiting the Configure Code Macro page in Administration, the following stack trace is thrown:

    Cause
    org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDefaultLanguageResource' in class com.atlassian.confluence.ext.code.config.ConfigureNewcodeAction threw exception com.atlassian.confluence.ext.code.languages.UnknownLanguageException at /templates/macros/newcode/config/configure-newcode.vm[line 7, column 26]
        at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
    caused by: com.atlassian.confluence.ext.code.languages.UnknownLanguageException
        at com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl.getLanguage(LanguageRegistryImpl.java:53)
    Stack Trace:[hide]
    org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDefaultLanguageResource' in  class com.atlassian.confluence.ext.code.config.ConfigureNewcodeAction threw exception com.atlassian.confluence.ext.code.languages.UnknownLanguageException at /templates/macros/newcode/config/configure-newcode.vm[line 7, column 26]
    	at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
    	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
    	at org.apache.velocity.context.ProxyVMContext.get(ProxyVMContext.java:222)
    	at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:843)
    	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:222)
    	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507)
    	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:155)
    	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
    	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
    	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)
    	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 com.opensymphony.webwork.dispatcher.VelocityResult.doExecute(VelocityResult.java:91)
    	at com.atlassian.xwork.results.ProfiledVelocityResult.doExecute(ProfiledVelocityResult.java:21)
    	at com.atlassian.confluence.setup.webwork.EncodingVelocityResult.doExecute(EncodingVelocityResult.java:48)
    	at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:116)
    	at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:263)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:187)
    	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:65)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.xwork.interceptors.XsrfTokenInterceptor.intercept(XsrfTokenInterceptor.java:100)
    	at com.atlassian.confluence.xwork.ConfluenceXsrfTokenInterceptor.intercept(ConfluenceXsrfTokenInterceptor.java:26)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.security.interceptors.CaptchaInterceptor.intercept(CaptchaInterceptor.java:50)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.validation.MessageHolderInterceptor.intercept(MessageHolderInterceptor.java:43)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.util.LoggingContextInterceptor.intercept(LoggingContextInterceptor.java:52)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.core.CancellingInterceptor.intercept(CancellingInterceptor.java:24)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.xwork.HttpMethodValidationInterceptor.intercept(HttpMethodValidationInterceptor.java:72)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.security.websudo.WebSudoInterceptor.intercept(WebSudoInterceptor.java:37)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.themes.ThemeContextInterceptor.intercept(ThemeContextInterceptor.java:68)
    [...]
    Caused by: com.atlassian.confluence.ext.code.languages.UnknownLanguageException
    	at com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl.getLanguage(LanguageRegistryImpl.java:53)
    	at com.atlassian.confluence.ext.code.config.ConfigureNewcodeAction.getDefaultLanguage(ConfigureNewcodeAction.java:127)
    	at com.atlassian.confluence.ext.code.config.ConfigureNewcodeAction.getDefaultLanguageAlias(ConfigureNewcodeAction.java:141)
    	at com.atlassian.confluence.ext.code.config.ConfigureNewcodeAction.getDefaultLanguageResource(ConfigureNewcodeAction.java:165)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
    	at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:533)
    	at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
    	... 322 more
    

    Any existing code macros display the code on pages but without any syntax highlighting. When you edit the macro itself (or insert a new one) there's an error above the code preview "Error rendering macro 'code': Invalid value specified for parameter 'lang'", and the Syntax Highlighting dropdown says "java" and nothing else. Enabling and disabling the plugin hasn't done anything, nor has a restart. No obvious errors are logged when disabling/enabling the plugin too.

    When viewing the code macro on a page, the following error may be displayed above the contents of the code-macro:

    Error rendering macro 'code': Invalid value specified for parameter 'lang'
    

    I haven't been able to reproduce this in a test environment, but we've got 3 support cases so far.

    Attachments

      Issue Links

        Activity

          People

            vvo Vu Truong Vo (Inactive)
            nmason Nick Mason
            Votes:
            20 Vote for this issue
            Watchers:
            50 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: