You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "yangxikun (via GitHub)" <gi...@apache.org> on 2023/02/07 13:50:15 UTC

[GitHub] [apisix] yangxikun opened a new issue, #8810: bug: mocking plugin panic when response_example contain $

yangxikun opened a new issue, #8810:
URL: https://github.com/apache/apisix/issues/8810

   ### Current Behavior
   
   lua entry thread aborted, cause http 500 response.
   
   ### Expected Behavior
   
   Should not abort.
   
   ### Error Logs
   
   ```
   2023/02/06 16:20:21 [error] 52#52: *75286 lua entry thread aborted: runtime error: /usr/local/apisix-2.13.2/apisix/core/utils.lua:298: attempt to index upvalue '_ctx' (a nil value)
   stack traceback:
   coroutine 0:
   	/usr/local/apisix-2.13.2/apisix/core/utils.lua: in function 'replace'
   	/usr/local/openresty/lualib/resty/core/regex.lua:1003: in function 're_gsub'
   	/usr/local/apisix-2.13.2/apisix/core/utils.lua:319: in function 'resolve_var'
   	/usr/local/apisix-2.13.2/apisix/plugins/mocking.lua:221: in function 'phase_func'
   	/usr/local/apisix-2.13.2/apisix/plugin.lua:748: in function 'run_plugin'
   	/usr/local/apisix-2.13.2/apisix/init.lua:481: in function 'http_access_phase'
   	access_by_lua(nginx.conf:300):2: in main chunk
   ```
   
   ### Steps to Reproduce
   
   config mocking like:
   ```yaml
   routes:
     -
       uri: /hello
       upstream:
         nodes:
           "127.0.0.1:1980": 1
         type: roundrobin
       plugins:
         mocking:
           response_example: '{"$a":1}'
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): master branch
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] yangxikun commented on issue #8810: bug: mocking plugin panic when response_example contain $

Posted by "yangxikun (via GitHub)" <gi...@apache.org>.
yangxikun commented on issue #8810:
URL: https://github.com/apache/apisix/issues/8810#issuecomment-1422237583

   Ok, Let me try.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] monkeyDluffy6017 commented on issue #8810: bug: mocking plugin panic when response_example contain $

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #8810:
URL: https://github.com/apache/apisix/issues/8810#issuecomment-1422077855

   I think you are right, would you like to fix this and add some test cases ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: mocking plugin panic when response_example contain $ [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8810:
URL: https://github.com/apache/apisix/issues/8810#issuecomment-1931695224

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: mocking plugin panic when response_example contain $ [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8810: bug: mocking plugin panic when response_example contain $
URL: https://github.com/apache/apisix/issues/8810


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: mocking plugin panic when response_example contain $ [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8810:
URL: https://github.com/apache/apisix/issues/8810#issuecomment-1907803130

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] yangxikun commented on issue #8810: bug: mocking plugin panic when response_example contain $

Posted by "yangxikun (via GitHub)" <gi...@apache.org>.
yangxikun commented on issue #8810:
URL: https://github.com/apache/apisix/issues/8810#issuecomment-1420808572

   The bug code line: https://github.com/apache/apisix/blob/5984321c34d3cdc90573ebbecfd17ba9082fb3ba/apisix/plugins/mocking.lua#L221
   
   Should call `core.utils.resolve_var(response_content, ctx.var)`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org