openresty / openresty/lua-resty-upload

lua-nginx-module report http v2 not supported yet unexpectedly

Open
#50 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
414
Forks
110
Avg merge
2h 43m
Merged PRs (30d)
1

Description

I'm using the following version of Nginx.

nginx version: nginx/1.14.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_stub_status_module --with-threads --with-stream --with-stream_ssl_module --add-module=/tmp/ngx_devel_kit-0.3.0 --add-module=/tmp/lua-nginx-module-0.10.9rc7

I have defined four virtual servers in http config block. One virtual server is defined with listen 443 ssl;, while three other virtual servers are defined with listen 443 ssl http2;. The lua-nginx-module is used in the server without http2 configured to handle file upload. The code is as follows.

local req_socket = ngx.req.socket
local sock, err = req_socket()
if not sock then
    return nil, err
end

Strange thing is the error.log reports that http v2 is not supported yet. But the http2 is not even configured in this virtual server. The error log is as below.

2019/04/29 15:26:19 [error] 22281#22281: *6512 lua entry thread aborted: runtime error: /opt/nginx/co
nf/lua/resty/upload.lua:61: http v2 not supported yet
stack traceback:
coroutine 0:
        [C]: in function 'req_socket'
        /opt/nginx/conf/lua/resty/upload.lua:61: in function 'new'

It looks like the http2 configuration exists beyond the virtual server in which it's configured, like somehow it becomes a global thing.
After I delete the http2 in all three other virtual servers, the error.log stops reporting the error mentioned above.
I don't know what make this happen. Is it a bug or something wrong with my configuration?

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 lua/resty/upload.lua at line 61 and reproduce the reported setup using one listen 443 ssl; virtual server alongside three listen 443 ssl http2; servers. Compare the error-log behavior with and without the other http2 directives; done means determining whether this is an nginx configuration effect or a lua-resty-upload bug and documenting the result.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.