2017/08/10 15:20:13 [error] 28241#28241: *888 failed to run body_filter_by_lua*: error loading module 'cjson' from file '/usr/local/openresty/lualib/cjson.so': /usr/local/openresty/lualib/cjson.so: undefined symbol: luaL_setfuncsstack traceback: [C]: at 0x7ff6b795e390 [C]: in function 'require'nginx.conf ,使用/usr/local/openresty/bin/resty 直接执行没有问题,但是接口请求就有问题。简化为下面例子``` location /test { content_by_lua_block { local cjson = require "cjson" local time = ngx.time() local data = "" = "/test",prot = 80, time = time} ngx.say(cjson.encode(data)) } }```版本: openresty/1.11.2.3在测试环境等安装的就没问题,版本:openresty/1.11.2.2 搜了一下,有个类似的问题: https://groups.google.com/forum/#!searchin/openresty/$2Fusr$2Flocal$2Fopenresty$2Flualib$2Fcjson.so$3A$20undefined$20symbol$3A$20luaL_setfuncs%7Csort:relevance/openresty/6djrwzhYeAg/5AI0rHP2AAAJ-----分割线----调试了几个小时,现在好了,上面的例子也完全没问题,接口请求也没问题了。感觉自己在做梦,要不是查了下log,真真切切的确实存在,我就真以为活在梦里。嗯,我再好好测测,看是否会再次出现
location /test {
content_by_lua_block {
local cjson = require "cjson"
local time = ngx.time()
local data = "" = "/test",prot = 80, time = time}
ngx.say(cjson.encode(data))
}
openresty/1.11.2.3