openresty / lua-resty-upstream-healthcheck

Health Checker for Nginx Upstream Servers in Pure Lua
521 stars 134 forks source link

ngx_lua 0.9.5+ required #72

Open mjhuber opened 4 years ago

mjhuber commented 4 years ago

when using openresty/openresty:1.15.8.3-2-alpine-fat image I receive an error that ngx_lua 0.9.5+ is required.

web_1  | 2020/05/22 21:49:48 [error] 8#8: init_worker_by_lua error: /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: ngx_lua 0.9.5+ required
web_1  | stack traceback:
web_1  |    [C]: in function 'error'
web_1  |    /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: in main chunk
web_1  |    [C]: in function 'require'
web_1  |    init_worker_by_lua:2: in main chunk
web_1  | 2020/05/22 21:49:48 [error] 6#6: init_worker_by_lua error: /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: ngx_lua 0.9.5+ required
web_1  | stack traceback:
web_1  |    [C]: in function 'error'
web_1  |    /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: in main chunk
web_1  |    [C]: in function 'require'
web_1  |    init_worker_by_lua:2: in main chunk
web_1  | 2020/05/22 21:49:48 [error] 9#9: init_worker_by_lua error: /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: ngx_lua 0.9.5+ required
web_1  | stack traceback:
web_1  |    [C]: in function 'error'
web_1  |    /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: in main chunk
web_1  |    [C]: in function 'require'
web_1  |    init_worker_by_lua:2: in main chunk
web_1  | 2020/05/22 21:49:48 [error] 7#7: init_worker_by_lua error: /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: ngx_lua 0.9.5+ required
web_1  | stack traceback:
web_1  |    [C]: in function 'error'
web_1  |    /usr/local/openresty/lualib/resty/upstream/healthcheck.lua:28: in main chunk
web_1  |    [C]: in function 'require'
web_1  |    init_worker_by_lua:2: in main chunk
/ # nginx -V
nginx version: openresty/1.15.8.3
built by gcc 9.2.0 (Alpine 9.2.0)
built with OpenSSL 1.1.1g  21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl/include' --add-module=../ngx_devel_kit-0.3.1rc1 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.15 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.7 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib' --with-pcre --with-compat --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-ipv6 --with-mail --with-mail_ssl_module --with-md5-asm --with-pcre-jit --with-sha1-asm --with-stream --with-stream_ssl_module --with-threads --with-stream --with-stream_ssl_preread_module
spacewander commented 4 years ago

Interesting.

if not ngx.config
   or not ngx.config.ngx_lua_version
   or ngx.config.ngx_lua_version < 9005
then
    error("ngx_lua 0.9.5+ required")
end

Could you add some code in /usr/local/openresty/lualib/resty/upstream/healthcheck.lua and print the value of ngx.config.ngx_lua_version?

darkydash commented 3 years ago

Having the same issue here https://github.com/openresty/openresty/issues/702