openresty / lua-resty-core

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

openresty/1.15.8.1 ngx.proecss doesn't support stream #279

Open xdays opened 5 years ago

xdays commented 5 years ago

Lua code:

local process = require "ngx.process"
process.signal_graceful_exit()

Nginx config:

stream {
    log_format basic '$remote_addr [$time_local] '
        '$protocol $status $bytes_sent $bytes_received '
        '$session_time $upstream_addr $upstream_first_byte_time';
    access_log logs/access.log basic;

    resolver 8.8.8.8;

    lua_shared_dict servers 1M;
    lua_shared_dict stats 1M;
    lua_package_path "/usr/local/openresty/nginx/app/?.lua;;";
    init_worker_by_lua_file app/init.lua;

    upstream backend {
        server 0.0.0.1:1234;
        balancer_by_lua_file app/balancer.lua;
    }

    server {
        listen       443;
        proxy_pass backend;
        proxy_connect_timeout 5s;
        log_by_lua_file app/stats.lua;
    }

    server {
        listen       445;
        content_by_lua_file app/content.lua;
    }
}

Error log:

2019/10/03 14:44:25 [error] 32426#32426: init_worker_by_lua_file error: /usr/local/openresty/lualib/ngx/process.lua:5: unsupported subsystem: stream
stack traceback:
    [C]: in function 'error'
    /usr/local/openresty/lualib/resty/core/base.lua:222: in function 'allows_subsystem'
    /usr/local/openresty/lualib/ngx/process.lua:5: in main chunk
    [C]: in function 'require'
    /usr/local/openresty/nginx/app/panel.lua:4: in main chunk
    [C]: in function 'require'
    /usr/local/openresty/nginx/app/init.lua:1: in main chunk
kayrus commented 3 years ago

I also face this issue:

2021/02/19 10:30:49 [error] 34#34: init_by_lua error: init_by_lua:30: require failed: /usr/local/lib/lua/ngx/ocsp.lua:5: unsupported subsystem: stream
stack traceback:
        [C]: in function 'error'
        init_by_lua:30: in main chunk

relates to https://github.com/openresty/stream-lua-nginx-module/issues/226

kayrus commented 3 years ago

Also relates to https://trac.nginx.org/nginx/ticket/1675