openresty / lua-resty-core

New FFI-based API for lua-nginx-module
801 stars 272 forks source link

2022/06/14 05:43:28 [error] 159#0: *45 lua entry thread aborted: runtime error: /opt/nginx/lib/lua/resty/core/misc.lua:178: /usr/local/lib/libluajit-5.1.so.2: undefined symbol: ngx_http_lua_ffi_req_is_internal stack traceback: coroutine 0: [C]: in function '__index' /opt/nginx/lib/lua/resty/core/misc.lua:178: in function 'is_internal' /opt/nginx/scripts/manage_access_session.lua:70: in main chunk, client: 10.221.16.1 #397

Closed vkhulbey closed 2 years ago

vkhulbey commented 2 years ago

Using openresty with Nginx-1.22. LuaJit, version-2.1 lua-nginx-module-0.10.21

cppcoffee commented 2 years ago

Please use luajit2, not lua 5.1.

vkhulbey commented 2 years ago

Please use luajit2, not lua 5.1.

We are already using LuaJit-2(http://github.com/openresty/luajit2.git).

vkhulbey commented 2 years ago

@cppcoffee

Here is a small code snippet.

if not ngx.req.is_internal() then local access_control = ngx.shared.access_control

This call goes to function ngx.req.is_internal() in /lib/resty/core/misc.lua and it fails at line 178 during the call to local rc = C.ngx_http_lua_ffi_req_is_internal(r)

vkhulbey commented 2 years ago

@cppcoffee Another observation that I made:

ngx_http_lua_ffi_req_is_internal method is present in master/src/ngx_http_lua_misc.c whereas it's missing in 0.10.21.x/src/ngx_http_lua_misc.c

zhuizhuhaomeng commented 2 years ago

so you use the latest lua-resty-core with the lua-nginx-module from openresty-1.21.4.1?

vkhulbey commented 2 years ago

openresty

We are getting lua-resty-core from https://github.com/openresty/lua-resty-core which fetches master branch. Is it not in sync with openresty-1.21.4.1? With this, we are using lua-nginx-module version 0.10.21.

zhuizhuhaomeng commented 2 years ago

you need to use both the latest version of lua-resty-core and lua-nginx-module.

vkhulbey commented 2 years ago

lua-resty-core and lua-nginx-module.

We are already on lua-nginx-module -0.10.21. For lua-resty-core, should we take it from https://github.com/openresty/lua-resty-core or https://openresty.org/en/download.html?

vkhulbey commented 2 years ago

you need to use both the latest version of lua-resty-core and lua-nginx-module.

Can you please confirm the latest version for lua-resty-core. Is it v0.1.23 ?

zhuizhuhaomeng commented 2 years ago

both from github master branch or both from the latest tag works.

vkhulbey commented 2 years ago

The issue was resolved after using both from the latest release tag. Hence, closed this ticket.