Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-19969

Invalid nested variables in Plan Variables cause Freemarker error on Branch Variables page

    XMLWordPrintable

Details

    Description

      Summary

      If invalid nested variables are set in the Plan configuration, the Branch variables page is blank and the dropdown menu shows only cascading variables.groupby.

      Steps to Reproduce

      1. Create a plan
      2. Create a branch on that plan
      3. Add a variable with Key foo to the Plan
      4. Override the value of variable foo, with a value including a Nested Variable eg: ${system.test_variable_name}
      5. Go to the Variables tab of the Branch configuration

      Expected Results

      We are able to edit the Branch variables to override the values

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      ...2018-06-26 15:38:41,628 WARN [http-nio-8085-exec-32] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.build.admin.config.variable.ConfigurePlanVariables) could not locate the message resource with key 'variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.'
      2018-06-26 15:38:41,628 WARN [http-nio-8085-exec-32] [TextProviderHelper] The default value expression 'variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.' was evaluated and did not match a property. The literal value 'variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.variables.groupby.' will be used.
      2018-06-26 15:38:41,629 ERROR [http-nio-8085-exec-32] [runtime] Error executing FreeMarker template
      FreeMarker template error:
      The following has evaluated to null or missing:
      ==> stack.findValue(parameters.listKey)  [in template "template/simple/select.ftl" at line 89, column 36]
      
      ----
      Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
      ----
      
      ----
      FTL stack trace ("~" means nesting-related):
      	- Failed at: #assign itemKey = stack.findValue(par...  [in template "template/simple/select.ftl" at line 89, column 17]
      	- Reached through: @ww.iterator value="parameters.list"  [in template "template/simple/select.ftl" at line 66, column 5]
      ----
      
      Java stack trace (for programmers):
      ----
      freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
      	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
      	at freemarker.core.Assignment.accept(Assignment.java:139)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:368)
      	at freemarker.core.Environment.visitAndTransform(Environment.java:460)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:332)
      	at freemarker.core.Environment.visit(Environment.java:332)
      	at freemarker.core.Environment.process(Environment.java:305)
      	at freemarker.template.Template.process(Template.java:384)
      	at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:152)
      	at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:589)
      	at org.apache.struts2.components.UIBean.end(UIBean.java:539)
      	at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackWriter.java:84)
      	at freemarker.core.Environment.visitAndTransform(Environment.java:461)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:368)
      	at freemarker.core.Environment.invoke(Environment.java:714)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:86)
      	at freemarker.core.Environment.visit(Environment.java:362)
      	at freemarker.core.Environment.visitAndTransform(Environment.java:460)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111)
      	at freemarker.core.Environment.visit(Environment.java:362)
      	at freemarker.core.Environment.invoke(Environment.java:714)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:86)
      	at freemarker.core.Environment.visit(Environment.java:362)
      	at freemarker.core.Environment.visitAndTransform(Environment.java:460)
      	at freemarker.core.BlockAssignment.accept(BlockAssignment.java:55)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:332)
      	at freemarker.core.Environment.process(Environment.java:305)
      	at freemarker.template.Template.process(Template.java:384)
      	at org.apache.struts2.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:185)
      	at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208)
      	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:100)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:100)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.atlassian.bamboo.ww2.interceptors.FieldErrorUsageVerifier.intercept(FieldErrorUsageVerifier.java:43)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.atlassian.bamboo.ww2.interceptors.JSONValidationInterceptor.doIntercept(JSONValidationInterceptor.java:60)
      	at com.atlassian.bamboo.ww2.interceptors.AbstractBambooInterceptor.intercept(AbstractBambooInterceptor.java:25)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.atlassian.bamboo.ww2.interceptors.SimpleConversionErrorInterceptor.intercept(SimpleConversionErrorInterceptor.java:64)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.atlassian.bamboo.ww2.interceptors.BambooXsrfTokenInterceptor.doIntercept(BambooXsrfTokenInterceptor.java:69)
      	at com.atlassian.bamboo.ww2.interceptors.AbstractBambooInterceptor.intercept(AbstractBambooInterceptor.java:25)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
      	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      ...
      

      Workaround

      Please remove any references to nested variables, and leave the values of variables as the expanded variable.

      Attachments

        Activity

          People

            mgardias Marcin Gardias
            ezeidan Elias Zeidan
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: