openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.3k stars 2.03k forks source link

openresty 1.15.8.1 get_request nil value, 1.13.6.2 working good #1576

Open ghost opened 5 years ago

ghost commented 5 years ago
2019/08/19 09:54:04 [error] 48#48: *17299 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/core/ctx.lua:34: attempt to call upvalue 'get_request' (a nil value)
stack traceback:
coroutine 0:
    /usr/local/openresty/lualib/resty/core/ctx.lua: in function '__index'

openresty 1.15.8.1 get_request nil value, 1.13.6.2 working good

thibaultcha commented 5 years ago

Hi,

It would be nice to have more information from your environment to help you resolve this. Are you using a formal OpenResty bundle (i.e. not compiling Nginx with ngx_lua yourself)?

A likely cause I can think of is that your system's LuaJIT installation overrides OpenResty's LuaJIT. Please run ldd on your OpenResty nginx binary. Please also start OpenResty with LD_DEBUG=libs nginx ... in order to display which LuaJIT library is loaded by your OpenResty instance.

ghost commented 5 years ago

@thibaultcha I am using the official docker image, 1.15.8.1-centos

1.15.8.1-2-centos 100 MB
Last update: 2 months ago

https://hub.docker.com/r/openresty/openresty/tags?page=4

thibaultcha commented 5 years ago

@netroby Please provide a minimal example reproducing the issue (e.g. your nginx.conf file and the commands you are using to start the container and make the request). Thanks.

piotrp commented 5 years ago

Maybe it helps you: I was getting a similar error (or the same? I don't remember) because I was using ngx.re in init phase. It worked in 1.13 (despite documentation saying that it shouldn't) and stopped in 1.15.

thibaultcha commented 5 years ago

@Crack Hi,

Please see this comment for the existing workarounds to use ngx.re with a static PCRE build in 1.15.8.x.

piotrp commented 5 years ago

In init_by_lua*? Documentation don't list it as an allowed phase so I assumed that it wasn't supposed top work there.