IntelliJ-EmmyLua
IntelliJ-EmmyLua copied to clipboard
kong插件远程调试下插件不能正常工作
Environment(环境)
| name | version |
|---|---|
| IDEA version | [e.g. IC2017.2 EAP, CL2018.1.2] |
| EmmyLua version | [e.g. v1.2.9] |
| OS | [e.g. Windows 10] |
What are the steps to reproduce this issue?(重现步骤?)
kong中的代码access.lua:
-- 插件开关
if conf.remotedebug_enable then
require('mobdebug').start(conf.remotedebug_host)
end
local uri_captures = ngx.ctx.router_matches.uri_captures
local upstream_uri = conf.uri_template
...
if conf.remotedebug_enable then
require('mobdebug').done()
end
What happens?(出现什么问题?)
kong插件远程出发调试后没有进入idea中代码的断点, 整个过程感觉插件是没有进行正常工作的
What were you expecting to happen?(期望?)
插件支持kong插件的远程调试
Any logs, error output, etc?(有没有什么log, error输出?)
kong走到断点后的报错日志如下:
2019/07/28 11:44:56 [error] 34#0: *1076 lua coroutine: runtime error: ...al/share/lua/5.1/kong/plugins/uri-transformer/access.lua:20: Debugger connection closed
stack traceback:
coroutine 0:
...al/share/lua/5.1/kong/plugins/uri-transformer/access.lua: in function 'execute'
...l/share/lua/5.1/kong/plugins/uri-transformer/handler.lua:14: in function <...l/share/lua/5.1/kong/plugins/uri-transformer/handler.lua:12>
coroutine 1:
[C]: in function 'resume'
coroutine.wrap:21: in function <coroutine.wrap:21>
/usr/local/share/lua/5.1/kong/init.lua:699: in function 'access'
access_by_lua(nginx-kong.conf:99):2: in function <access_by_lua(nginx-kong.conf:99):1>, client: 192.168.224.1, server: kong, request: "GET /favicon_ico HTTP/1.1", host: "ziyu0123456789.cn:8443"
idea的调试控制台显示:
Start mobdebug server at port:8172
Waiting for process connection...
Connected.
这一步给我的感觉是服务端的lua代码已经连上了idea了, 但是不明白为什么没有进入代码的断点, 一段时间后就会disconnected
Any other comments?(其它说明)
- 整个过程给我最直观的感觉像是sourcemap, 不过插件没有给出更多的错误说明;
- 我代码一行么有动改用
zerobrane进行调试一切正常;
用最新版本试试https://ci.appveyor.com/project/EmmyLua/intellij-emmylua-7n83m/build/artifacts