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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]