Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-1911

Both the capture and assign liquid variables result in an HTTP 500 error returned to client

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • None
    • 2.4 GA
    • Gateway
    • None
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Hide

      Using other control flow tags like if to achieve the desired result

      Show
      Using other control flow tags like if to achieve the desired result

    Description

      When using the capture variable in a liquid expression for the Header modification policy an HTTP 500 error code is returned to the client. The following was captured in the relevant error log:

      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] policy_chain.lua:162: rewrite(): policy chain execute phase: rewrite, policy: Find Service Policy, i: 2
      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] policy_chain.lua:162: rewrite(): policy chain execute phase: rewrite, policy: Local Policy Chain, i: 3
      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] cache_handler.lua:23: new(): backend cache handler: strict
      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] policy_chain.lua:162: rewrite(): policy chain execute phase: rewrite, policy: APIcast, i: 1
      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] service.lua:227: get_usage(): [mapping] service 2555417729090 has 3 rules
      2019/02/12 16:04:59 [debug] 26#26: *207 [lua] policy_chain.lua:162: rewrite(): policy chain execute phase: rewrite, policy: Headers policy, i: 2
      2019/02/12 16:04:59 [error] 26#26: *207 lua entry thread aborted: runtime error: /opt/app-root/src/src/apicast/linked_list.lua:19: readonly list
      stack traceback:
      coroutine 0:
      	[C]: in function 'error'
      	/opt/app-root/src/src/apicast/linked_list.lua:19: in function '__newindex'
      	/usr/local/share/lua/5.1/liquid.lua:2512: in function 'define_var'
      	/usr/local/share/lua/5.1/liquid.lua:2459: in function 'visit'
      	/usr/local/share/lua/5.1/liquid.lua:1975: in function 'render'
      	/opt/app-root/src/src/apicast/policy/headers/headers.lua:91: in function 'run_commands'
      	/opt/app-root/src/src/apicast/policy/headers/headers.lua:151: in function </opt/app-root/src/src/apicast/policy/headers/headers.lua:147>
      	/opt/app-root/src/src/apicast/policy_chain.lua:163: in function 'rewrite'
      	...-root/src/src/apicast/policy/local_chain/local_chain.lua:56: in function <...-root/src/src/apicast/policy/local_chain/local_chain.lua:51>
      	/opt/app-root/src/src/apicast/policy_chain.lua:163: in function 'rewrite'
      	rewrite_by_lua(lua_tuzuPb:466):3: in function <rewrite_by_lua(lua_tuzuPb:466):1>, client: 172.17.0.1, server: _, request: "GET /test/foo?user_key=aaf4768100d2326ccb418738ac1fc1ff HTTP/1.1", host: "localhost:8080"
      

      The liquid expression in its simplest form that can reproduce the error would be:

      {% capture mapping_rule %}

      HelloWorld

      {% endcapture %}

      mapping_rule

      This should in fact output the string "HelloWorld"

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-keprice Kevin Price
            Eloy Coto Eloy Coto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: