openresty / openresty/lua-nginx-module

Can't work with nginx-quic branch

Open
#1,887 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

Got these errors when I use nginx-quic branch (for http3):

lua entry thread aborted: runtime error: access_by_lua()...
API disabled in the current context
stack traceback
.../lib/resty/core/request.lua:287: in function 'get_method'
...

Reason I guess:
r->connection->fd is -1 for requests in quic stream, lua-nginx-module take the normal http3/quic requests as 'fake requests' or bad requests. So, lua-nginx-module can not work with http3/quic requests.

related codes:

ngx_http_lua_ffi_req_get_method(ngx_http_request_t *r)
{
    if (r->connection->fd == (ngx_socket_t) -1) {
        return NGX_HTTP_LUA_FFI_BAD_CONTEXT;
    }
    return r->method;
}
ngx_quic_create_stream(ngx_connection_t *c, uint64_t id)
{
    ...
    ngx_connection_t       *sc;
    ...
    sc = ngx_get_connection(-1, log);
    ...
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/resty/core/request.lua:287 and the ngx_http_lua_ffi_req_get_method entry point, then compare it with ngx_quic_create_stream and its connection setup. Reproduce the access_by_lua() failure on the nginx-quic branch and determine the expected request context; done means the reported request API works for HTTP/3/QUIC streams without the API-disabled error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, nginx
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.