openresty / lua-nginx-module

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

quiche and lua-nginx-module: runtime error: no request found #1651

Open livid opened 4 years ago

livid commented 4 years ago

I was playing with the quiche HTTP/3 patch from Cloudflare and built NGINX with the following configuration:

nginx version: nginx/1.16.1
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
built with OpenSSL 1.1.0 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --user=nginx --group=nginx --pid-path=/var/run/nginx.pid --with-debug --with-compat --with-threads --with-stream --with-stream_ssl_module --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-http_slice_module --with-http_realip_module --with-http_sub_module --with-http_mp4_module --with-http_flv_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-http_secure_link_module --with-http_geoip_module --with-pcre=/opt/src/pcre-8.43 --with-pcre-jit --with-openssl=/opt/src/quiche/deps/boringssl --with-quiche=/opt/src/quiche --with-ipv6 --add-module=/opt/src/ngx_brotli --add-module=/opt/src/ngx_cache_purge-2.3 --add-module=/opt/src/ngx_devel_kit-0.2.19 --add-module=/opt/src/lua-nginx-module-0.10.16rc3 --add-module=/opt/src/lua-upstream-cache-nginx-module-0.1.1 --with-ld-opt=-L/usr/local/lib/ --with-cc-opt=-I/usr/local/include/hiredis/ --add-module=/opt/src/selective-cache-purge-module --add-module=/opt/src/ngx_http_geoip2_module-3.2 --add-module=/opt/src/echo-nginx-module

Then I found Lua module stopped working and threw this runtime error:

2020/02/20 07:23:19 [error] 14861#14861: *6 lua entry thread aborted: runtime error: access_by_lua(orca_1.conf:1791):2: no request found
stack traceback:
coroutine 0:
    [C]: in function '__index'
    access_by_lua(orca_1.conf:1791):2: in main chunk, client: 10.0.2.2, server: 212f49dd4e.test.orca.io, request: "GET / HTTP/1.1", host: "www.example.com"

I know the quiche patch from Cloudflare is not production-ready. So I submitted the issue report for informational purposes. Maybe someone who is also testing HTTP/3 out can pick this up. Thanks in advance!

splitice commented 4 years ago

A list of quiche issues would be good. i.e do other hooks work (body_by_lua, etc?). They would probably suffer the same issue. What about sockets? light threads? timers?

As I understand it that error message relates to ngx_http_lua_set_req not being called. Either that or ngx_http_request_t is null in the `ngx_httplua_by_chunk` methods.